From 16987a2f7c4a1bfa70d2cdae470adbbb4b369904 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 29 Jul 2021 21:53:40 -0500 Subject: [PATCH] Put CSC and GEM-CSC local trigger lookup tables in ES objects --- .../python/CSCL1TPLookupTable_cff.py | 78 ++++++ .../src/CSCL1TPLookupTableEP.cc | 211 ++++++++++++++++ .../interface/CSCL1TPLookupTableCCLUT.h | 30 +++ .../interface/CSCL1TPLookupTableME11ILT.h | 145 +++++++++++ .../interface/CSCL1TPLookupTableME21ILT.h | 78 ++++++ .../src/CSCL1TPLookupTableME11ILT.cc | 228 ++++++++++++++++++ .../src/CSCL1TPLookupTableME21ILT.cc | 97 ++++++++ .../T_EventSetup_CSCL1TPLookupTableCCLUT.cc | 4 + .../T_EventSetup_CSCL1TPLookupTableME11ILT.cc | 4 + .../T_EventSetup_CSCL1TPLookupTableME21ILT.cc | 4 + CondFormats/CSCObjects/src/classes_def.xml | 13 +- CondFormats/CSCObjects/src/headers.h | 3 + .../test/testSerializationCSCObjects.cpp | 3 + .../interface/CSCL1TPLookupTableCCLUTRcd.h | 6 + .../interface/CSCL1TPLookupTableME11ILTRcd.h | 6 + .../interface/CSCL1TPLookupTableME21ILTRcd.h | 6 + .../src/CSCL1TPLookupTableCCLUTRcd.cc | 4 + .../src/CSCL1TPLookupTableME11ILTRcd.cc | 4 + .../src/CSCL1TPLookupTableME21ILTRcd.cc | 4 + .../interface/CSCALCTCrossCLCT.h | 42 +--- .../interface/CSCBaseboard.h | 3 +- .../interface/CSCCathodeLCTProcessor.h | 1 - .../interface/CSCGEMMatcher.h | 52 +--- .../interface/CSCLUTReader.h | 67 ----- .../interface/CSCMotherboard.h | 11 + .../interface/CSCTriggerPrimitivesBuilder.h | 6 + .../interface/ComparatorCodeLUT.h | 16 +- .../interface/GEMClusterProcessor.h | 55 +---- .../plugins/CSCTriggerPrimitivesProducer.cc | 34 +++ .../plugins/CSCTriggerPrimitivesProducer.h | 7 + .../python/cscTriggerPrimitiveDigis_cfi.py | 1 - .../python/params/cclutParams.py | 26 -- .../python/params/gemcscParams.py | 108 --------- .../python/params/tmbParams.py | 25 -- .../src/CSCALCTCrossCLCT.cc | 83 +++---- .../CSCTriggerPrimitives/src/CSCGEMMatcher.cc | 100 +++----- .../src/CSCGEMMotherboard.cc | 10 + .../CSCTriggerPrimitives/src/CSCLUTReader.cc | 171 ------------- .../src/CSCMotherboard.cc | 6 + .../src/CSCTriggerPrimitivesBuilder.cc | 48 ++++ .../src/ComparatorCodeLUT.cc | 16 +- .../src/GEMClusterProcessor.cc | 182 ++++++-------- 42 files changed, 1207 insertions(+), 791 deletions(-) create mode 100644 CalibMuon/CSCCalibration/python/CSCL1TPLookupTable_cff.py create mode 100644 CalibMuon/CSCCalibration/src/CSCL1TPLookupTableEP.cc create mode 100644 CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h create mode 100644 CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h create mode 100644 CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h create mode 100644 CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc create mode 100644 CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc create mode 100644 CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableCCLUT.cc create mode 100644 CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME11ILT.cc create mode 100644 CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME21ILT.cc create mode 100644 CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h create mode 100644 CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h create mode 100644 CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h create mode 100644 CondFormats/DataRecord/src/CSCL1TPLookupTableCCLUTRcd.cc create mode 100644 CondFormats/DataRecord/src/CSCL1TPLookupTableME11ILTRcd.cc create mode 100644 CondFormats/DataRecord/src/CSCL1TPLookupTableME21ILTRcd.cc delete mode 100644 L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h delete mode 100644 L1Trigger/CSCTriggerPrimitives/python/params/cclutParams.py delete mode 100644 L1Trigger/CSCTriggerPrimitives/src/CSCLUTReader.cc diff --git a/CalibMuon/CSCCalibration/python/CSCL1TPLookupTable_cff.py b/CalibMuon/CSCCalibration/python/CSCL1TPLookupTable_cff.py new file mode 100644 index 0000000000000..763dd1d1e2228 --- /dev/null +++ b/CalibMuon/CSCCalibration/python/CSCL1TPLookupTable_cff.py @@ -0,0 +1,78 @@ +import FWCore.ParameterSet.Config as cms + +CSCL1TPLookupTableEP = cms.ESSource( + "CSCL1TPLookupTableEP", + ## CCLUT + positionLUTFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat0_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat1_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat2_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat3_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat4_v1.txt" + ), + slopeLUTFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat0_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat1_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat2_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat3_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat4_v1.txt" + ), + ## convert pad number to 1/2-strip in ME1a + padToHsME1aFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1a_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1a_odd.txt", + ), + ## convert pad number to 1/2-strip in ME1b + padToHsME1bFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1b_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1b_odd.txt", + ), + ## convert pad number to 1/2-strip in ME21 + padToHsME21Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME21_odd.txt", + ), + ## convert pad number to 1/8-strip in ME1a + padToEsME1aFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1a_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1a_odd.txt", + ), + ## convert pad number to 1/8-strip in ME1b + padToEsME1bFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1b_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1b_odd.txt", + ), + ## convert pad number to 1/8-strip in ME21 + padToEsME21Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME21_odd.txt", + ), + ## convert eta partition to minimum wiregroup in ME11 + rollToMinWgME11Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME11_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME11_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME11_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME11_odd.txt", + ), + ## convert eta partition to maximum wiregroup in ME11 + rollToMaxWgME11Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME11_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME11_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME11_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME11_odd.txt", + ), + ## convert eta partition to minimum wiregroup in ME21 + rollToMinWgME21Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME21_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME21_odd.txt", + ), + ## convert eta partition to maximum wiregroup in ME21 + rollToMaxWgME21Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME21_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME21_odd.txt", + ), +) diff --git a/CalibMuon/CSCCalibration/src/CSCL1TPLookupTableEP.cc b/CalibMuon/CSCCalibration/src/CSCL1TPLookupTableEP.cc new file mode 100644 index 0000000000000..59ea974e68c30 --- /dev/null +++ b/CalibMuon/CSCCalibration/src/CSCL1TPLookupTableEP.cc @@ -0,0 +1,211 @@ +// system include files +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/FileInPath.h" +#include "FWCore/Framework/interface/SourceFactory.h" +#include "FWCore/Framework/interface/ModuleFactory.h" +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" + +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h" +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h" +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" + +// user include files +#include +#include +#include +#include + +class CSCL1TPLookupTableEP : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder { +public: + CSCL1TPLookupTableEP(const edm::ParameterSet&); + ~CSCL1TPLookupTableEP() override {} + + std::unique_ptr produceCCLUT(const CSCL1TPLookupTableCCLUTRcd&); + std::unique_ptr produceME11ILT(const CSCL1TPLookupTableME11ILTRcd&); + std::unique_ptr produceME21ILT(const CSCL1TPLookupTableME21ILTRcd&); + +protected: + void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, + const edm::IOVSyncValue&, + edm::ValidityInterval&) override; + +private: + std::vector load(std::string fileName) const; + const edm::ParameterSet& pset_; +}; + +CSCL1TPLookupTableEP::CSCL1TPLookupTableEP(const edm::ParameterSet& pset) : pset_(pset) { + setWhatProduced(this, &CSCL1TPLookupTableEP::produceCCLUT); + setWhatProduced(this, &CSCL1TPLookupTableEP::produceME11ILT); + setWhatProduced(this, &CSCL1TPLookupTableEP::produceME21ILT); +} + +void CSCL1TPLookupTableEP::setIntervalFor(const edm::eventsetup::EventSetupRecordKey& iKey, + const edm::IOVSyncValue& iTime, + edm::ValidityInterval& oInterval) { + oInterval = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime()); //infinite +} + +std::unique_ptr CSCL1TPLookupTableEP::produceCCLUT(const CSCL1TPLookupTableCCLUTRcd&) { + // make the LUT object + std::unique_ptr lut = std::make_unique(); + + // get the text files + std::vector positionLUTFiles_ = pset_.getParameter>("positionLUTFiles"); + std::vector slopeLUTFiles_ = pset_.getParameter>("slopeLUTFiles"); + + std::unordered_map> cclutPosition; + std::unordered_map> cclutSlope; + + // read the text files and extract the data + for (int i = 0; i < 5; ++i) { + cclutPosition[i] = load(positionLUTFiles_[i]); + cclutSlope[i] = load(slopeLUTFiles_[i]); + } + + // set the data in the LUT object + lut->set_cclutSlope(cclutPosition); + lut->set_cclutSlope(cclutSlope); + + return lut; +} + +std::unique_ptr CSCL1TPLookupTableEP::produceME11ILT(const CSCL1TPLookupTableME11ILTRcd&) { + // make the LUT object + std::unique_ptr lut = std::make_unique(); + + // get the text files + std::vector padToHsME1aFiles_ = pset_.getParameter>("padToHsME1aFiles"); + std::vector padToHsME1bFiles_ = pset_.getParameter>("padToHsME1bFiles"); + + std::vector padToEsME1aFiles_ = pset_.getParameter>("padToEsME1aFiles"); + std::vector padToEsME1bFiles_ = pset_.getParameter>("padToEsME1bFiles"); + + std::vector rollToMaxWgME11Files_ = pset_.getParameter>("rollToMaxWgME11Files"); + std::vector rollToMinWgME11Files_ = pset_.getParameter>("rollToMinWgME11Files"); + + // read the text files and extract the data + const auto& GEM_pad_CSC_hs_ME1a_even_ = load(padToHsME1aFiles_[0]); + const auto& GEM_pad_CSC_hs_ME1a_odd_ = load(padToHsME1aFiles_[1]); + const auto& GEM_pad_CSC_hs_ME1b_even_ = load(padToHsME1bFiles_[0]); + const auto& GEM_pad_CSC_hs_ME1b_odd_ = load(padToHsME1bFiles_[1]); + + const auto& GEM_pad_CSC_es_ME1a_even_ = load(padToEsME1aFiles_[0]); + const auto& GEM_pad_CSC_es_ME1a_odd_ = load(padToEsME1aFiles_[1]); + const auto& GEM_pad_CSC_es_ME1b_even_ = load(padToEsME1bFiles_[0]); + const auto& GEM_pad_CSC_es_ME1b_odd_ = load(padToEsME1bFiles_[1]); + + const auto& GEM_roll_L1_CSC_min_wg_ME11_even_ = load(rollToMinWgME11Files_[0]); + const auto& GEM_roll_L1_CSC_min_wg_ME11_odd_ = load(rollToMinWgME11Files_[1]); + const auto& GEM_roll_L2_CSC_min_wg_ME11_even_ = load(rollToMinWgME11Files_[2]); + const auto& GEM_roll_L2_CSC_min_wg_ME11_odd_ = load(rollToMinWgME11Files_[3]); + + const auto& GEM_roll_L1_CSC_max_wg_ME11_even_ = load(rollToMaxWgME11Files_[0]); + const auto& GEM_roll_L1_CSC_max_wg_ME11_odd_ = load(rollToMaxWgME11Files_[1]); + const auto& GEM_roll_L2_CSC_max_wg_ME11_even_ = load(rollToMaxWgME11Files_[2]); + const auto& GEM_roll_L2_CSC_max_wg_ME11_odd_ = load(rollToMaxWgME11Files_[3]); + + // set the data in the LUT object + lut->set_GEM_pad_CSC_hs_ME1b_even(GEM_pad_CSC_hs_ME1b_even_); + lut->set_GEM_pad_CSC_hs_ME1a_even(GEM_pad_CSC_hs_ME1a_even_); + lut->set_GEM_pad_CSC_hs_ME1b_odd(GEM_pad_CSC_hs_ME1b_odd_); + lut->set_GEM_pad_CSC_hs_ME1a_odd(GEM_pad_CSC_hs_ME1a_odd_); + + lut->set_GEM_pad_CSC_es_ME1b_even(GEM_pad_CSC_es_ME1b_even_); + lut->set_GEM_pad_CSC_es_ME1a_even(GEM_pad_CSC_es_ME1a_even_); + lut->set_GEM_pad_CSC_es_ME1b_odd(GEM_pad_CSC_es_ME1b_odd_); + lut->set_GEM_pad_CSC_es_ME1a_odd(GEM_pad_CSC_es_ME1a_odd_); + + lut->set_GEM_roll_L1_CSC_min_wg_ME11_even(GEM_roll_L1_CSC_min_wg_ME11_even_); + lut->set_GEM_roll_L1_CSC_max_wg_ME11_even(GEM_roll_L1_CSC_max_wg_ME11_even_); + lut->set_GEM_roll_L1_CSC_min_wg_ME11_odd(GEM_roll_L1_CSC_min_wg_ME11_odd_); + lut->set_GEM_roll_L1_CSC_max_wg_ME11_odd(GEM_roll_L1_CSC_max_wg_ME11_odd_); + + lut->set_GEM_roll_L2_CSC_min_wg_ME11_even(GEM_roll_L2_CSC_min_wg_ME11_even_); + lut->set_GEM_roll_L2_CSC_max_wg_ME11_even(GEM_roll_L2_CSC_max_wg_ME11_even_); + lut->set_GEM_roll_L2_CSC_min_wg_ME11_odd(GEM_roll_L2_CSC_min_wg_ME11_odd_); + lut->set_GEM_roll_L2_CSC_max_wg_ME11_odd(GEM_roll_L2_CSC_max_wg_ME11_odd_); + + return lut; +} + +std::unique_ptr CSCL1TPLookupTableEP::produceME21ILT(const CSCL1TPLookupTableME21ILTRcd&) { + // make the LUT object + std::unique_ptr lut = std::make_unique(); + + // get the text files + std::vector padToHsME21Files_ = pset_.getParameter>("padToHsME21Files"); + std::vector padToEsME21Files_ = pset_.getParameter>("padToEsME21Files"); + + std::vector rollToMaxWgME21Files_ = pset_.getParameter>("rollToMaxWgME21Files"); + std::vector rollToMinWgME21Files_ = pset_.getParameter>("rollToMinWgME21Files"); + + // read the text files and extract the data + const auto& GEM_pad_CSC_hs_ME21_even_ = load(padToHsME21Files_[0]); + const auto& GEM_pad_CSC_hs_ME21_odd_ = load(padToHsME21Files_[1]); + + const auto& GEM_pad_CSC_es_ME21_even_ = load(padToEsME21Files_[0]); + const auto& GEM_pad_CSC_es_ME21_odd_ = load(padToEsME21Files_[1]); + + const auto& GEM_roll_L1_CSC_min_wg_ME21_even_ = load(rollToMinWgME21Files_[0]); + const auto& GEM_roll_L1_CSC_min_wg_ME21_odd_ = load(rollToMinWgME21Files_[1]); + const auto& GEM_roll_L2_CSC_min_wg_ME21_even_ = load(rollToMinWgME21Files_[2]); + const auto& GEM_roll_L2_CSC_min_wg_ME21_odd_ = load(rollToMinWgME21Files_[3]); + + const auto& GEM_roll_L1_CSC_max_wg_ME21_even_ = load(rollToMaxWgME21Files_[0]); + const auto& GEM_roll_L1_CSC_max_wg_ME21_odd_ = load(rollToMaxWgME21Files_[1]); + const auto& GEM_roll_L2_CSC_max_wg_ME21_even_ = load(rollToMaxWgME21Files_[2]); + const auto& GEM_roll_L2_CSC_max_wg_ME21_odd_ = load(rollToMaxWgME21Files_[3]); + + // set the data in the LUT object + lut->set_GEM_pad_CSC_hs_ME21_even(GEM_pad_CSC_hs_ME21_even_); + lut->set_GEM_pad_CSC_hs_ME21_odd(GEM_pad_CSC_hs_ME21_odd_); + + lut->set_GEM_pad_CSC_es_ME21_even(GEM_pad_CSC_es_ME21_even_); + lut->set_GEM_pad_CSC_es_ME21_odd(GEM_pad_CSC_es_ME21_odd_); + + lut->set_GEM_roll_L1_CSC_min_wg_ME21_even(GEM_roll_L1_CSC_min_wg_ME21_even_); + lut->set_GEM_roll_L1_CSC_max_wg_ME21_even(GEM_roll_L1_CSC_max_wg_ME21_even_); + lut->set_GEM_roll_L1_CSC_min_wg_ME21_odd(GEM_roll_L1_CSC_min_wg_ME21_odd_); + lut->set_GEM_roll_L1_CSC_max_wg_ME21_odd(GEM_roll_L1_CSC_max_wg_ME21_odd_); + + lut->set_GEM_roll_L2_CSC_min_wg_ME21_even(GEM_roll_L2_CSC_min_wg_ME21_even_); + lut->set_GEM_roll_L2_CSC_max_wg_ME21_even(GEM_roll_L2_CSC_max_wg_ME21_even_); + lut->set_GEM_roll_L2_CSC_min_wg_ME21_odd(GEM_roll_L2_CSC_min_wg_ME21_odd_); + lut->set_GEM_roll_L2_CSC_max_wg_ME21_odd(GEM_roll_L2_CSC_max_wg_ME21_odd_); + + return lut; +} + +std::vector CSCL1TPLookupTableEP::load(std::string fileName) const { + + std::vector returnV; + std::ifstream fstream; + fstream.open(edm::FileInPath(fileName.c_str()).fullPath()); + // empty file, return empty lut + if (!fstream.good()) { + fstream.close(); + return returnV; + } + + std::string line; + + while (std::getline(fstream, line)) { + //ignore comments + line.erase(std::find(line.begin(), line.end(), '#'), line.end()); + std::istringstream lineStream(line); + std::pair entry; + while (lineStream >> entry.first >> entry.second) { + returnV.push_back(entry.second); + } + } + return returnV; +} + + +DEFINE_FWK_EVENTSETUP_SOURCE(CSCL1TPLookupTableEP); diff --git a/CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h new file mode 100644 index 0000000000000..6f67047d6f9b7 --- /dev/null +++ b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h @@ -0,0 +1,30 @@ +#ifndef CondFormats_CSCObjects_CSCL1TPLookupTableCCLUT_h +#define CondFormats_CSCObjects_CSCL1TPLookupTableCCLUT_h + +#include "CondFormats/Serialization/interface/Serializable.h" +#include +#include + +class CSCL1TPLookupTableCCLUT { +public: + CSCL1TPLookupTableCCLUT() {} + ~CSCL1TPLookupTableCCLUT() {} + + typedef std::unordered_map > t_lut; + + // setters + void set_cclutPosition(const t_lut& lut) { cclutPosition_ = lut; } + void set_cclutSlope(const t_lut& lut) { cclutSlope_ = lut; } + + // getters + unsigned cclutPosition(unsigned pattern, unsigned code) const { return cclutPosition_.at(pattern)[code]; } + unsigned cclutSlope(unsigned pattern, unsigned code) const { return cclutSlope_.at(pattern)[code]; } + +private: + t_lut cclutPosition_; + t_lut cclutSlope_; + + COND_SERIALIZABLE; +}; + +#endif diff --git a/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h new file mode 100644 index 0000000000000..688b564d48bef --- /dev/null +++ b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h @@ -0,0 +1,145 @@ +#ifndef CondFormats_CSCObjects_CSCL1TPLookupTableME11ILT_h +#define CondFormats_CSCObjects_CSCL1TPLookupTableME11ILT_h + +#include "CondFormats/Serialization/interface/Serializable.h" +#include + +class CSCL1TPLookupTableME11ILT { +public: + CSCL1TPLookupTableME11ILT() {} + + ~CSCL1TPLookupTableME11ILT() {} + + // setters + void set_GEM_pad_CSC_hs_ME1b_even(const std::vector& lut); + void set_GEM_pad_CSC_hs_ME1a_even(const std::vector& lut); + void set_GEM_pad_CSC_hs_ME1b_odd(const std::vector& lut); + void set_GEM_pad_CSC_hs_ME1a_odd(const std::vector& lut); + + void set_GEM_pad_CSC_es_ME1b_even(const std::vector& lut); + void set_GEM_pad_CSC_es_ME1a_even(const std::vector& lut); + void set_GEM_pad_CSC_es_ME1b_odd(const std::vector& lut); + void set_GEM_pad_CSC_es_ME1a_odd(const std::vector& lut); + + void set_GEM_roll_L1_CSC_min_wg_ME11_even(const std::vector& lut); + void set_GEM_roll_L1_CSC_max_wg_ME11_even(const std::vector& lut); + void set_GEM_roll_L1_CSC_min_wg_ME11_odd(const std::vector& lut); + void set_GEM_roll_L1_CSC_max_wg_ME11_odd(const std::vector& lut); + + void set_GEM_roll_L2_CSC_min_wg_ME11_even(const std::vector& lut); + void set_GEM_roll_L2_CSC_max_wg_ME11_even(const std::vector& lut); + void set_GEM_roll_L2_CSC_min_wg_ME11_odd(const std::vector& lut); + void set_GEM_roll_L2_CSC_max_wg_ME11_odd(const std::vector& lut); + + // GEM-CSC trigger: slope correction + void set_CSC_slope_cosi_2to1_L1_ME11_even(const std::vector& lut); + void set_CSC_slope_cosi_2to1_L1_ME11_odd(const std::vector& lut); + void set_CSC_slope_cosi_3to1_L1_ME11_even(const std::vector& lut); + void set_CSC_slope_cosi_3to1_L1_ME11_odd(const std::vector& lut); + + void set_CSC_slope_cosi_corr_L1_ME11_even(const std::vector& lut); + void set_CSC_slope_cosi_corr_L2_ME11_even(const std::vector& lut); + void set_CSC_slope_cosi_corr_L1_ME11_odd(const std::vector& lut); + void set_CSC_slope_cosi_corr_L2_ME11_odd(const std::vector& lut); + + void set_CSC_slope_corr_L1_ME11_even(const std::vector& lut); + void set_CSC_slope_corr_L2_ME11_even(const std::vector& lut); + void set_CSC_slope_corr_L1_ME11_odd(const std::vector& lut); + void set_CSC_slope_corr_L2_ME11_odd(const std::vector& lut); + + // getters + unsigned GEM_pad_CSC_hs_ME1b_even(unsigned pad) const; + unsigned GEM_pad_CSC_hs_ME1a_even(unsigned pad) const; + unsigned GEM_pad_CSC_hs_ME1b_odd(unsigned pad) const; + unsigned GEM_pad_CSC_hs_ME1a_odd(unsigned pad) const; + + unsigned GEM_pad_CSC_es_ME1b_even(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME1a_even(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME1b_odd(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME1a_odd(unsigned pad) const; + + unsigned GEM_roll_L1_CSC_min_wg_ME11_even(unsigned roll) const; + unsigned GEM_roll_L1_CSC_max_wg_ME11_even(unsigned roll) const; + unsigned GEM_roll_L1_CSC_min_wg_ME11_odd(unsigned roll) const; + unsigned GEM_roll_L1_CSC_max_wg_ME11_odd(unsigned roll) const; + + unsigned GEM_roll_L2_CSC_min_wg_ME11_even(unsigned roll) const; + unsigned GEM_roll_L2_CSC_max_wg_ME11_even(unsigned roll) const; + unsigned GEM_roll_L2_CSC_min_wg_ME11_odd(unsigned roll) const; + unsigned GEM_roll_L2_CSC_max_wg_ME11_odd(unsigned roll) const; + + // GEM-CSC trigger: slope correction + unsigned CSC_slope_cosi_2to1_L1_ME11_even(unsigned channel) const; + unsigned CSC_slope_cosi_2to1_L1_ME11_odd(unsigned channel) const; + unsigned CSC_slope_cosi_3to1_L1_ME11_even(unsigned channel) const; + unsigned CSC_slope_cosi_3to1_L1_ME11_odd(unsigned channel) const; + + unsigned CSC_slope_cosi_corr_L1_ME11_even(unsigned channel) const; + unsigned CSC_slope_cosi_corr_L2_ME11_even(unsigned channel) const; + unsigned CSC_slope_cosi_corr_L1_ME11_odd(unsigned channel) const; + unsigned CSC_slope_cosi_corr_L2_ME11_odd(unsigned channel) const; + + unsigned CSC_slope_corr_L1_ME11_even(unsigned channel) const; + unsigned CSC_slope_corr_L2_ME11_even(unsigned channel) const; + unsigned CSC_slope_corr_L1_ME11_odd(unsigned channel) const; + unsigned CSC_slope_corr_L2_ME11_odd(unsigned channel) const; + + // GEM-CSC trigger: 1/8-strip difference to slope + unsigned es_diff_slope_L1_ME1a_even(unsigned es_diff) const { return 0; } + unsigned es_diff_slope_L2_ME1a_even(unsigned es_diff) const { return 0; } + unsigned es_diff_slope_L1_ME1a_odd(unsigned es_diff) const { return 0; } + unsigned es_diff_slope_L2_ME1a_odd(unsigned es_diff) const { return 0; } + unsigned es_diff_slope_L1_ME1b_even(unsigned es_diff) const { return 0; } + unsigned es_diff_slope_L2_ME1b_even(unsigned es_diff) const { return 0; } + unsigned es_diff_slope_L1_ME1b_odd(unsigned es_diff) const { return 0; } + unsigned es_diff_slope_L2_ME1b_odd(unsigned es_diff) const { return 0; } + +private: + std::vector GEM_pad_CSC_hs_ME1b_even_; + std::vector GEM_pad_CSC_hs_ME1a_even_; + std::vector GEM_pad_CSC_hs_ME1b_odd_; + std::vector GEM_pad_CSC_hs_ME1a_odd_; + + std::vector GEM_pad_CSC_es_ME1b_even_; + std::vector GEM_pad_CSC_es_ME1a_even_; + std::vector GEM_pad_CSC_es_ME1b_odd_; + std::vector GEM_pad_CSC_es_ME1a_odd_; + + std::vector GEM_roll_L1_CSC_min_wg_ME11_even_; + std::vector GEM_roll_L1_CSC_max_wg_ME11_even_; + std::vector GEM_roll_L1_CSC_min_wg_ME11_odd_; + std::vector GEM_roll_L1_CSC_max_wg_ME11_odd_; + + std::vector GEM_roll_L2_CSC_min_wg_ME11_even_; + std::vector GEM_roll_L2_CSC_max_wg_ME11_even_; + std::vector GEM_roll_L2_CSC_min_wg_ME11_odd_; + std::vector GEM_roll_L2_CSC_max_wg_ME11_odd_; + + std::vector CSC_slope_cosi_2to1_L1_ME11_even_; + std::vector CSC_slope_cosi_2to1_L1_ME11_odd_; + std::vector CSC_slope_cosi_3to1_L1_ME11_even_; + std::vector CSC_slope_cosi_3to1_L1_ME11_odd_; + + std::vector CSC_slope_cosi_corr_L1_ME11_even_; + std::vector CSC_slope_cosi_corr_L2_ME11_even_; + std::vector CSC_slope_cosi_corr_L1_ME11_odd_; + std::vector CSC_slope_cosi_corr_L2_ME11_odd_; + + std::vector CSC_slope_corr_L1_ME11_even_; + std::vector CSC_slope_corr_L2_ME11_even_; + std::vector CSC_slope_corr_L1_ME11_odd_; + std::vector CSC_slope_corr_L2_ME11_odd_; + + std::vector es_diff_slope_L1_ME1a_even_; + std::vector es_diff_slope_L2_ME1a_even_; + std::vector es_diff_slope_L1_ME1a_odd_; + std::vector es_diff_slope_L2_ME1a_odd_; + std::vector es_diff_slope_L1_ME1b_even_; + std::vector es_diff_slope_L2_ME1b_even_; + std::vector es_diff_slope_L1_ME1b_odd_; + std::vector es_diff_slope_L2_ME1b_odd_; + + COND_SERIALIZABLE; +}; + +#endif diff --git a/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h new file mode 100644 index 0000000000000..9c813a0056ebb --- /dev/null +++ b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h @@ -0,0 +1,78 @@ +#ifndef CondFormats_CSCObjects_CSCL1TPLookupTableME21ILT_h +#define CondFormats_CSCObjects_CSCL1TPLookupTableME21ILT_h + +#include "CondFormats/Serialization/interface/Serializable.h" +#include + +class CSCL1TPLookupTableME21ILT { +public: + CSCL1TPLookupTableME21ILT() {} + + ~CSCL1TPLookupTableME21ILT() {} + + // setters + void set_GEM_pad_CSC_hs_ME21_even(const std::vector& lut); + void set_GEM_pad_CSC_hs_ME21_odd(const std::vector& lut); + + void set_GEM_pad_CSC_es_ME21_even(const std::vector& lut); + void set_GEM_pad_CSC_es_ME21_odd(const std::vector& lut); + + void set_GEM_roll_L1_CSC_min_wg_ME21_even(const std::vector& lut); + void set_GEM_roll_L1_CSC_max_wg_ME21_even(const std::vector& lut); + void set_GEM_roll_L1_CSC_min_wg_ME21_odd(const std::vector& lut); + void set_GEM_roll_L1_CSC_max_wg_ME21_odd(const std::vector& lut); + + void set_GEM_roll_L2_CSC_min_wg_ME21_even(const std::vector& lut); + void set_GEM_roll_L2_CSC_max_wg_ME21_even(const std::vector& lut); + void set_GEM_roll_L2_CSC_min_wg_ME21_odd(const std::vector& lut); + void set_GEM_roll_L2_CSC_max_wg_ME21_odd(const std::vector& lut); + + // getters + unsigned GEM_pad_CSC_hs_ME21_even(unsigned pad) const; + unsigned GEM_pad_CSC_hs_ME21_odd(unsigned pad) const; + + unsigned GEM_pad_CSC_es_ME21_even(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME21_odd(unsigned pad) const; + + unsigned GEM_roll_L1_CSC_min_wg_ME21_even(unsigned roll) const; + unsigned GEM_roll_L1_CSC_max_wg_ME21_even(unsigned roll) const; + unsigned GEM_roll_L1_CSC_min_wg_ME21_odd(unsigned roll) const; + unsigned GEM_roll_L1_CSC_max_wg_ME21_odd(unsigned roll) const; + + unsigned GEM_roll_L2_CSC_min_wg_ME21_even(unsigned roll) const; + unsigned GEM_roll_L2_CSC_max_wg_ME21_even(unsigned roll) const; + unsigned GEM_roll_L2_CSC_min_wg_ME21_odd(unsigned roll) const; + unsigned GEM_roll_L2_CSC_max_wg_ME21_odd(unsigned roll) const; + + // GEM-CSC trigger: 1/8-strip difference to slope + unsigned es_diff_slope_L1_ME21_even(unsigned es_diff) const { return 0; } + unsigned es_diff_slope_L2_ME21_even(unsigned es_diff) const { return 0; } + unsigned es_diff_slope_L1_ME21_odd(unsigned es_diff) const { return 0; } + unsigned es_diff_slope_L2_ME21_odd(unsigned es_diff) const { return 0; } + +private: + std::vector GEM_pad_CSC_hs_ME21_even_; + std::vector GEM_pad_CSC_hs_ME21_odd_; + + std::vector GEM_pad_CSC_es_ME21_even_; + std::vector GEM_pad_CSC_es_ME21_odd_; + + std::vector GEM_roll_L1_CSC_min_wg_ME21_even_; + std::vector GEM_roll_L1_CSC_max_wg_ME21_even_; + std::vector GEM_roll_L1_CSC_min_wg_ME21_odd_; + std::vector GEM_roll_L1_CSC_max_wg_ME21_odd_; + + std::vector GEM_roll_L2_CSC_min_wg_ME21_even_; + std::vector GEM_roll_L2_CSC_max_wg_ME21_even_; + std::vector GEM_roll_L2_CSC_min_wg_ME21_odd_; + std::vector GEM_roll_L2_CSC_max_wg_ME21_odd_; + + std::vector es_diff_slope_L1_ME21_even_; + std::vector es_diff_slope_L2_ME21_even_; + std::vector es_diff_slope_L1_ME21_odd_; + std::vector es_diff_slope_L2_ME21_odd_; + + COND_SERIALIZABLE; +}; + +#endif diff --git a/CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc new file mode 100644 index 0000000000000..3c7579fe58856 --- /dev/null +++ b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc @@ -0,0 +1,228 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" + +// GEM-CSC trigger: coordinate conversion +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1b_even(const std::vector& lut) { + GEM_pad_CSC_hs_ME1b_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1a_even(const std::vector& lut) { + GEM_pad_CSC_hs_ME1a_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1b_odd(const std::vector& lut) { + GEM_pad_CSC_hs_ME1b_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1a_odd(const std::vector& lut) { + GEM_pad_CSC_hs_ME1a_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1b_even(const std::vector& lut) { + GEM_pad_CSC_es_ME1b_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1a_even(const std::vector& lut) { + GEM_pad_CSC_es_ME1a_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1b_odd(const std::vector& lut) { + GEM_pad_CSC_es_ME1b_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1a_odd(const std::vector& lut) { + GEM_pad_CSC_es_ME1a_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_min_wg_ME11_even(const std::vector& lut) { + GEM_roll_L1_CSC_min_wg_ME11_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_max_wg_ME11_even(const std::vector& lut) { + GEM_roll_L1_CSC_max_wg_ME11_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_min_wg_ME11_odd(const std::vector& lut) { + GEM_roll_L1_CSC_min_wg_ME11_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_max_wg_ME11_odd(const std::vector& lut) { + GEM_roll_L1_CSC_max_wg_ME11_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_min_wg_ME11_even(const std::vector& lut) { + GEM_roll_L2_CSC_min_wg_ME11_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_max_wg_ME11_even(const std::vector& lut) { + GEM_roll_L2_CSC_max_wg_ME11_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_min_wg_ME11_odd(const std::vector& lut) { + GEM_roll_L2_CSC_min_wg_ME11_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_max_wg_ME11_odd(const std::vector& lut) { + GEM_roll_L2_CSC_max_wg_ME11_odd_ = lut; +} + +// GEM-CSC trigger: slope correction +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_2to1_L1_ME11_even(const std::vector& lut) { + CSC_slope_cosi_2to1_L1_ME11_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_2to1_L1_ME11_odd(const std::vector& lut) { + CSC_slope_cosi_2to1_L1_ME11_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_3to1_L1_ME11_even(const std::vector& lut) { + CSC_slope_cosi_3to1_L1_ME11_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_3to1_L1_ME11_odd(const std::vector& lut) { + CSC_slope_cosi_3to1_L1_ME11_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L1_ME11_even(const std::vector& lut) { + CSC_slope_cosi_corr_L1_ME11_even_ = lut; +} +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L2_ME11_even(const std::vector& lut) { + CSC_slope_cosi_corr_L2_ME11_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L1_ME11_odd(const std::vector& lut) { + CSC_slope_cosi_corr_L1_ME11_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L2_ME11_odd(const std::vector& lut) { + CSC_slope_cosi_corr_L2_ME11_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L1_ME11_even(const std::vector& lut) { + CSC_slope_corr_L1_ME11_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L2_ME11_even(const std::vector& lut) { + CSC_slope_corr_L2_ME11_even_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L1_ME11_odd(const std::vector& lut) { + CSC_slope_corr_L1_ME11_odd_ = lut; +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L2_ME11_odd(const std::vector& lut) { + CSC_slope_corr_L2_ME11_odd_ = lut; +} + +// GEM-CSC trigger: coordinate conversion +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1b_even(unsigned pad) const { + return GEM_pad_CSC_hs_ME1b_even_[pad]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1a_even(unsigned pad) const { + return GEM_pad_CSC_hs_ME1a_even_[pad]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1b_odd(unsigned pad) const { + return GEM_pad_CSC_hs_ME1b_odd_[pad]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1a_odd(unsigned pad) const { + return GEM_pad_CSC_hs_ME1a_odd_[pad]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1b_even(unsigned pad) const { + return GEM_pad_CSC_es_ME1b_even_[pad]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1a_even(unsigned pad) const { + return GEM_pad_CSC_es_ME1a_even_[pad]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1b_odd(unsigned pad) const { + return GEM_pad_CSC_es_ME1b_odd_[pad]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1a_odd(unsigned pad) const { + return GEM_pad_CSC_es_ME1a_odd_[pad]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_min_wg_ME11_even(unsigned roll) const { + return GEM_roll_L1_CSC_min_wg_ME11_even_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_max_wg_ME11_even(unsigned roll) const { + return GEM_roll_L1_CSC_max_wg_ME11_even_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_min_wg_ME11_odd(unsigned roll) const { + return GEM_roll_L1_CSC_min_wg_ME11_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_max_wg_ME11_odd(unsigned roll) const { + return GEM_roll_L1_CSC_max_wg_ME11_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_min_wg_ME11_even(unsigned roll) const { + return GEM_roll_L2_CSC_min_wg_ME11_even_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_max_wg_ME11_even(unsigned roll) const { + return GEM_roll_L2_CSC_max_wg_ME11_even_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_min_wg_ME11_odd(unsigned roll) const { + return GEM_roll_L2_CSC_min_wg_ME11_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_max_wg_ME11_odd(unsigned roll) const { + return GEM_roll_L2_CSC_max_wg_ME11_odd_[roll]; +} + +// GEM-CSC trigger: slope correction +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_2to1_L1_ME11_even(unsigned slope) const { + return CSC_slope_cosi_2to1_L1_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_2to1_L1_ME11_odd(unsigned slope) const { + return CSC_slope_cosi_2to1_L1_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_3to1_L1_ME11_even(unsigned slope) const { + return CSC_slope_cosi_3to1_L1_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_3to1_L1_ME11_odd(unsigned slope) const { + return CSC_slope_cosi_3to1_L1_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L1_ME11_even(unsigned slope) const { + return CSC_slope_cosi_corr_L1_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L1_ME11_odd(unsigned slope) const { + return CSC_slope_cosi_corr_L1_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L2_ME11_even(unsigned slope) const { + return CSC_slope_cosi_corr_L2_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L2_ME11_odd(unsigned slope) const { + return CSC_slope_cosi_corr_L2_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L1_ME11_even(unsigned slope) const { + return CSC_slope_corr_L1_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L1_ME11_odd(unsigned slope) const { + return CSC_slope_corr_L1_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L2_ME11_even(unsigned slope) const { + return CSC_slope_corr_L2_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L2_ME11_odd(unsigned slope) const { + return CSC_slope_corr_L2_ME11_odd_[slope]; +} diff --git a/CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc new file mode 100644 index 0000000000000..e8a42542b9a7e --- /dev/null +++ b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc @@ -0,0 +1,97 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" + +void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_hs_ME21_even(const std::vector& lut) { + GEM_pad_CSC_hs_ME21_even_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_hs_ME21_odd(const std::vector& lut) { + GEM_pad_CSC_hs_ME21_odd_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_es_ME21_even(const std::vector& lut) { + GEM_pad_CSC_es_ME21_even_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_es_ME21_odd(const std::vector& lut) { + GEM_pad_CSC_es_ME21_odd_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L1_CSC_min_wg_ME21_even(const std::vector& lut) { + GEM_roll_L1_CSC_min_wg_ME21_even_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L1_CSC_max_wg_ME21_even(const std::vector& lut) { + GEM_roll_L1_CSC_max_wg_ME21_even_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L1_CSC_min_wg_ME21_odd(const std::vector& lut) { + GEM_roll_L1_CSC_min_wg_ME21_odd_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L1_CSC_max_wg_ME21_odd(const std::vector& lut) { + GEM_roll_L1_CSC_max_wg_ME21_odd_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L2_CSC_min_wg_ME21_even(const std::vector& lut) { + GEM_roll_L2_CSC_min_wg_ME21_even_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L2_CSC_max_wg_ME21_even(const std::vector& lut) { + GEM_roll_L2_CSC_max_wg_ME21_even_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L2_CSC_min_wg_ME21_odd(const std::vector& lut) { + GEM_roll_L2_CSC_min_wg_ME21_odd_ = lut; +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L2_CSC_max_wg_ME21_odd(const std::vector& lut) { + GEM_roll_L2_CSC_max_wg_ME21_odd_ = lut; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_hs_ME21_even(unsigned pad) const { + return GEM_pad_CSC_hs_ME21_even_[pad]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_hs_ME21_odd(unsigned pad) const { + return GEM_pad_CSC_hs_ME21_odd_[pad]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_es_ME21_even(unsigned pad) const { + return GEM_pad_CSC_es_ME21_even_[pad]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_es_ME21_odd(unsigned pad) const { + return GEM_pad_CSC_es_ME21_odd_[pad]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_min_wg_ME21_even(unsigned roll) const { + return GEM_roll_L1_CSC_min_wg_ME21_even_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_max_wg_ME21_even(unsigned roll) const { + return GEM_roll_L1_CSC_max_wg_ME21_even_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_min_wg_ME21_odd(unsigned roll) const { + return GEM_roll_L1_CSC_min_wg_ME21_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_max_wg_ME21_odd(unsigned roll) const { + return GEM_roll_L1_CSC_max_wg_ME21_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_min_wg_ME21_even(unsigned roll) const { + return GEM_roll_L2_CSC_min_wg_ME21_even_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_max_wg_ME21_even(unsigned roll) const { + return GEM_roll_L2_CSC_max_wg_ME21_even_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_min_wg_ME21_odd(unsigned roll) const { + return GEM_roll_L2_CSC_min_wg_ME21_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_max_wg_ME21_odd(unsigned roll) const { + return GEM_roll_L2_CSC_max_wg_ME21_odd_[roll]; +} diff --git a/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableCCLUT.cc b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableCCLUT.cc new file mode 100644 index 0000000000000..9deec5db3b5cf --- /dev/null +++ b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableCCLUT.cc @@ -0,0 +1,4 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(CSCL1TPLookupTableCCLUT); diff --git a/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME11ILT.cc b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME11ILT.cc new file mode 100644 index 0000000000000..69fd0f8efbed9 --- /dev/null +++ b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME11ILT.cc @@ -0,0 +1,4 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(CSCL1TPLookupTableME11ILT); diff --git a/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME21ILT.cc b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME21ILT.cc new file mode 100644 index 0000000000000..bb452ba805264 --- /dev/null +++ b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME21ILT.cc @@ -0,0 +1,4 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(CSCL1TPLookupTableME21ILT); diff --git a/CondFormats/CSCObjects/src/classes_def.xml b/CondFormats/CSCObjects/src/classes_def.xml index 5355aff34ee2c..4ec72ea55e9ea 100644 --- a/CondFormats/CSCObjects/src/classes_def.xml +++ b/CondFormats/CSCObjects/src/classes_def.xml @@ -15,13 +15,13 @@ - + - + @@ -99,9 +99,13 @@ - + + + + + @@ -134,5 +138,4 @@ - - + diff --git a/CondFormats/CSCObjects/src/headers.h b/CondFormats/CSCObjects/src/headers.h index 29296e98f17c6..496bc998f6f8a 100644 --- a/CondFormats/CSCObjects/src/headers.h +++ b/CondFormats/CSCObjects/src/headers.h @@ -26,3 +26,6 @@ #include "CondFormats/CSCObjects/interface/CSCTriggerMapping.h" #include "CondFormats/CSCObjects/interface/CSCL1TPParameters.h" #include "CondFormats/CSCObjects/interface/CSCDBL1TPParameters.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" diff --git a/CondFormats/CSCObjects/test/testSerializationCSCObjects.cpp b/CondFormats/CSCObjects/test/testSerializationCSCObjects.cpp index d36fbf5e1e22a..49d8d6fb57ddb 100644 --- a/CondFormats/CSCObjects/test/testSerializationCSCObjects.cpp +++ b/CondFormats/CSCObjects/test/testSerializationCSCObjects.cpp @@ -34,6 +34,9 @@ int main() { testSerialization(); testSerialization(); testSerialization(); + testSerialization(); + testSerialization(); + testSerialization(); testSerialization(); testSerialization(); testSerialization(); diff --git a/CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h b/CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h new file mode 100644 index 0000000000000..c94fbe6dd2139 --- /dev/null +++ b/CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h @@ -0,0 +1,6 @@ +#ifndef CondFormats_DataRecord_CSCL1TPLookupTableCCLUTRcd +#define CondFormats_DataRecord_CSCL1TPLookupTableCCLUTRcd +#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" +class CSCL1TPLookupTableCCLUTRcd + : public edm::eventsetup::EventSetupRecordImplementation {}; +#endif diff --git a/CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h b/CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h new file mode 100644 index 0000000000000..96fdacb936c58 --- /dev/null +++ b/CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h @@ -0,0 +1,6 @@ +#ifndef CondFormats_DataRecord_CSCL1TPLookupTableME11ILTRcd +#define CondFormats_DataRecord_CSCL1TPLookupTableME11ILTRcd +#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" +class CSCL1TPLookupTableME11ILTRcd + : public edm::eventsetup::EventSetupRecordImplementation {}; +#endif diff --git a/CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h b/CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h new file mode 100644 index 0000000000000..c9930715a9534 --- /dev/null +++ b/CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h @@ -0,0 +1,6 @@ +#ifndef CondFormats_DataRecord_CSCL1TPLookupTableME21ILTRcd +#define CondFormats_DataRecord_CSCL1TPLookupTableME21ILTRcd +#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" +class CSCL1TPLookupTableME21ILTRcd + : public edm::eventsetup::EventSetupRecordImplementation {}; +#endif diff --git a/CondFormats/DataRecord/src/CSCL1TPLookupTableCCLUTRcd.cc b/CondFormats/DataRecord/src/CSCL1TPLookupTableCCLUTRcd.cc new file mode 100644 index 0000000000000..cf8d9849d459e --- /dev/null +++ b/CondFormats/DataRecord/src/CSCL1TPLookupTableCCLUTRcd.cc @@ -0,0 +1,4 @@ +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(CSCL1TPLookupTableCCLUTRcd); diff --git a/CondFormats/DataRecord/src/CSCL1TPLookupTableME11ILTRcd.cc b/CondFormats/DataRecord/src/CSCL1TPLookupTableME11ILTRcd.cc new file mode 100644 index 0000000000000..5b634bee1ed4f --- /dev/null +++ b/CondFormats/DataRecord/src/CSCL1TPLookupTableME11ILTRcd.cc @@ -0,0 +1,4 @@ +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(CSCL1TPLookupTableME11ILTRcd); diff --git a/CondFormats/DataRecord/src/CSCL1TPLookupTableME21ILTRcd.cc b/CondFormats/DataRecord/src/CSCL1TPLookupTableME21ILTRcd.cc new file mode 100644 index 0000000000000..2bb72edae143d --- /dev/null +++ b/CondFormats/DataRecord/src/CSCL1TPLookupTableME21ILTRcd.cc @@ -0,0 +1,4 @@ +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(CSCL1TPLookupTableME21ILTRcd); diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCALCTCrossCLCT.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCALCTCrossCLCT.h index 9d5f4bfb6dac5..8859e661b1e06 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCALCTCrossCLCT.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCALCTCrossCLCT.h @@ -26,7 +26,6 @@ this feature into the CSC trigger firmware #include #include -class CSCLUTReader; class CSCALCTDigi; class CSCCLCTDigi; @@ -35,25 +34,6 @@ class CSCALCTCrossCLCT { CSCALCTCrossCLCT( unsigned endcap, unsigned station, unsigned ring, bool ignoreAlctCrossClct, const edm::ParameterSet& conf); - /* - Calculate the 4-bit code for the best LCT and second LCT. Each code corresponds - to a unique combination for best and second best. Not each combation is valid. - Valid best LCT codes are: 11, 12, 21, 22, and 0 - Valid second LCT codes are: 12, 21, 22, and 0 - When a code is nonzero, the first index is the ALCT. The second index is the CLCT. - - This feature was originally added by Vadim Khotilovich in LS1 to potentially improve the - quality of the LCTs sent to the track-finder. Generally the track-finders - request all information to be sent. Even if the resulting LCT is potentially - unphysical. Therefore, this function is not used. - */ - void calculateLCTCodes(const CSCALCTDigi& a1, - const CSCCLCTDigi& c1, - const CSCALCTDigi& a2, - const CSCCLCTDigi& c2, - unsigned& bestLCTCode, - unsigned& secondLCTCode) const; - /* Check if an ALCT can cross a CLCT. Most of the time it can. Only in ME1/1 there are special cases when they do not. This function is typically not used though, as the @@ -71,21 +51,13 @@ class CSCALCTCrossCLCT { bool gangedME1a_; bool ignoreAlctCrossClct_; - // strings to paths of LUTs - std::vector wgCrossHsME1aFiles_; - std::vector wgCrossHsME1aGangedFiles_; - std::vector wgCrossHsME1bFiles_; - std::vector lctCombinationCodeFiles_; - - // unique pointers to the luts - std::unique_ptr wg_cross_min_hs_ME1a_; - std::unique_ptr wg_cross_max_hs_ME1a_; - std::unique_ptr wg_cross_min_hs_ME1a_ganged_; - std::unique_ptr wg_cross_max_hs_ME1a_ganged_; - std::unique_ptr wg_cross_min_hs_ME1b_; - std::unique_ptr wg_cross_max_hs_ME1b_; - std::unique_ptr code_to_best_lct_; - std::unique_ptr code_to_second_lct_; + // LUTs to map wiregroup onto min and max half-strip number that it crosses in ME1/1 + static const std::vector wg_min_hs_ME1a_; + static const std::vector wg_max_hs_ME1a_; + static const std::vector wg_min_hs_ME1a_ganged_; + static const std::vector wg_max_hs_ME1a_ganged_; + static const std::vector wg_min_hs_ME1b_; + static const std::vector wg_max_hs_ME1b_; }; #endif diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h index 8f8bec666d091..76df7a6588439 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h @@ -8,7 +8,6 @@ #include "Geometry/CSCGeometry/interface/CSCGeometry.h" #include "DataFormats/CSCDigi/interface/CSCConstants.h" #include "L1Trigger/CSCTriggerPrimitives/interface/CSCPatternBank.h" -#include "L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h" #include "CondFormats/CSCObjects/interface/CSCDBL1TPParameters.h" class CSCBaseboard { @@ -31,6 +30,8 @@ class CSCBaseboard { std::string getCSCName() const { return theCSCName_; } + CSCDetId id() const { return cscId_; } + protected: void checkConfigParameters(unsigned int& var, const unsigned int var_max, diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCCathodeLCTProcessor.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCCathodeLCTProcessor.h index 5607f048e4427..d711f07a885a6 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCCathodeLCTProcessor.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCCathodeLCTProcessor.h @@ -34,7 +34,6 @@ #include "DataFormats/CSCDigi/interface/CSCCLCTDigi.h" #include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigi.h" #include "L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h" -#include "L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h" #include "L1Trigger/CSCTriggerPrimitives/interface/LCTQualityControl.h" #include "L1Trigger/CSCTriggerPrimitives/interface/ComparatorCodeLUT.h" #include "L1Trigger/CSCTriggerPrimitives/interface/PulseArray.h" diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h index 80c2116b27cc6..d141242367bb4 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h @@ -11,11 +11,12 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" #include #include -class CSCLUTReader; class CSCALCTDigi; class CSCCLCTDigi; class GEMInternalCluster; @@ -30,6 +31,9 @@ class CSCGEMMatcher { const edm::ParameterSet& tmbParams, const edm::ParameterSet& luts); + void setESLookupTables(const CSCL1TPLookupTableME11ILT* conf); + void setESLookupTables(const CSCL1TPLookupTableME21ILT* conf); + // calculate the bending angle unsigned calculateGEMCSCBending(const CSCCLCTDigi& clct, const GEMInternalCluster& cluster) const; @@ -106,6 +110,10 @@ class CSCGEMMatcher { GEMInternalCluster& best) const; private: + // access to lookup tables via eventsetup + const CSCL1TPLookupTableME11ILT* lookupTableME11ILT_; + const CSCL1TPLookupTableME21ILT* lookupTableME21ILT_; + //mitigate slope by consistency of slope indicator, if necessary uint16_t mitigatedSlopeByConsistency(const CSCCLCTDigi& clct) const; @@ -130,48 +138,6 @@ class CSCGEMMatcher { bool assign_gem_csc_bending_; bool mitigateSlopeByCosi_; - - // strings to paths of LUTs - std::vector gemCscSlopeCorrectionFiles_; - std::vector gemCscSlopeCosiFiles_; - std::vector gemCscSlopeCosiCorrectionFiles_; - std::vector esDiffToSlopeME1aFiles_; - std::vector esDiffToSlopeME1bFiles_; - std::vector esDiffToSlopeME21Files_; - - // unique pointers to the luts - std::unique_ptr gem_csc_slope_cosi_2to1_L1_ME11_even_; - std::unique_ptr gem_csc_slope_cosi_3to1_L1_ME11_even_; - std::unique_ptr gem_csc_slope_cosi_2to1_L1_ME11_odd_; - std::unique_ptr gem_csc_slope_cosi_3to1_L1_ME11_odd_; - - std::unique_ptr gem_csc_slope_corr_L1_ME11_even_; - std::unique_ptr gem_csc_slope_corr_L2_ME11_even_; - std::unique_ptr gem_csc_slope_corr_L1_ME11_odd_; - std::unique_ptr gem_csc_slope_corr_L2_ME11_odd_; - - std::unique_ptr gem_csc_slope_cosi_corr_L1_ME11_even_; - std::unique_ptr gem_csc_slope_cosi_corr_L2_ME11_even_; - std::unique_ptr gem_csc_slope_cosi_corr_L1_ME11_odd_; - std::unique_ptr gem_csc_slope_cosi_corr_L2_ME11_odd_; - - std::unique_ptr es_diff_slope_L1_ME1b_even_; - std::unique_ptr es_diff_slope_L2_ME1b_even_; - - std::unique_ptr es_diff_slope_L1_ME1b_odd_; - std::unique_ptr es_diff_slope_L2_ME1b_odd_; - - std::unique_ptr es_diff_slope_L1_ME1a_even_; - std::unique_ptr es_diff_slope_L2_ME1a_even_; - - std::unique_ptr es_diff_slope_L1_ME1a_odd_; - std::unique_ptr es_diff_slope_L2_ME1a_odd_; - - std::unique_ptr es_diff_slope_L1_ME21_even_; - std::unique_ptr es_diff_slope_L2_ME21_even_; - - std::unique_ptr es_diff_slope_L1_ME21_odd_; - std::unique_ptr es_diff_slope_L2_ME21_odd_; }; #endif diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h deleted file mode 100644 index cbbc6475612f4..0000000000000 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef L1Trigger_CSCTriggerPrimitives_CSCLUTReader -#define L1Trigger_CSCTriggerPrimitives_CSCLUTReader - -#include -#include -#include -#include -#include -#include - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -class CSCLUTReader { -public: - enum ReadCodes { - SUCCESS = 0, - NO_ENTRIES = 1, - DUP_ENTRIES = 2, - MISS_ENTRIES = 3, - MAX_ADDRESS_OUTOFRANGE = 4, - NO_HEADER = 5 - }; - - /* CSCLUTReader(); */ - explicit CSCLUTReader(const std::string&); - ~CSCLUTReader() {} - - float lookup(int code) const; - float lookupPacked(const int input) const; - - // populates the map. - void initialize(); - - unsigned checkedInput(unsigned in, unsigned maxWidth) const; - - // I/O functions - void save(std::ofstream& output); - int load(const std::string& inFileName); - - float data(unsigned int address) const; - int read(std::istream& stream); - void write(std::ostream& stream) const; - - unsigned int nrBitsAddress() const { return nrBitsAddress_; } - unsigned int nrBitsData() const { return nrBitsData_; } - //following the convention of vector::size() - unsigned int maxSize() const; - bool empty() const { return data_.empty(); } - -private: - std::string fname_; - int readHeader(std::istream&); - - unsigned int nrBitsAddress_; //technically redundant with addressMask - unsigned int nrBitsData_; //technically redundant with dataMask - unsigned int addressMask_; - unsigned int dataMask_; - - std::vector data_; - - int m_codeInWidth; - unsigned m_outWidth; - bool m_initialized; -}; - -#endif diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCMotherboard.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCMotherboard.h index a13d9315a4f1c..31fa856dc6f1c 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCMotherboard.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCMotherboard.h @@ -43,6 +43,9 @@ #include "L1Trigger/CSCTriggerPrimitives/interface/LCTQualityAssignment.h" #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h" #include "DataFormats/CSCDigi/interface/CSCShowerDigi.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" class CSCMotherboard : public CSCBaseboard { public: @@ -93,6 +96,9 @@ class CSCMotherboard : public CSCBaseboard { /** Set configuration parameters obtained via EventSetup mechanism. */ void setConfigParameters(const CSCDBL1TPParameters* conf); + void setESLookupTables(const CSCL1TPLookupTableCCLUT* conf); + void setESLookupTables(const CSCL1TPLookupTableME11ILT* conf); + void setESLookupTables(const CSCL1TPLookupTableME21ILT* conf); /** Anode LCT processor. */ std::unique_ptr alctProc; @@ -102,6 +108,11 @@ class CSCMotherboard : public CSCBaseboard { // VK: change to protected, to allow inheritance protected: + // access to lookup tables via eventsetup + const CSCL1TPLookupTableCCLUT* lookupTableCCLUT_; + const CSCL1TPLookupTableME11ILT* lookupTableME11ILT_; + const CSCL1TPLookupTableME21ILT* lookupTableME21ILT_; + /* Containers for reconstructed ALCTs and CLCTs */ std::vector alctV; std::vector clctV; diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCTriggerPrimitivesBuilder.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCTriggerPrimitivesBuilder.h index 7df54732c4007..ebf6befaf46bf 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCTriggerPrimitivesBuilder.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCTriggerPrimitivesBuilder.h @@ -19,6 +19,9 @@ */ #include "CondFormats/CSCObjects/interface/CSCBadChambers.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" #include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h" #include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h" @@ -50,6 +53,9 @@ class CSCTriggerPrimitivesBuilder { /** Sets configuration parameters obtained via EventSetup mechanism. */ void setConfigParameters(const CSCDBL1TPParameters* conf); + void setESLookupTables(const CSCL1TPLookupTableCCLUT* conf); + void setESLookupTables(const CSCL1TPLookupTableME11ILT* conf); + void setESLookupTables(const CSCL1TPLookupTableME21ILT* conf); /// set CSC and GEM geometries for the matching needs void setCSCGeometry(const CSCGeometry* g) { csc_g = g; } diff --git a/L1Trigger/CSCTriggerPrimitives/interface/ComparatorCodeLUT.h b/L1Trigger/CSCTriggerPrimitives/interface/ComparatorCodeLUT.h index 9fae0a8cc5d3d..ff89a8f7a5db8 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/ComparatorCodeLUT.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/ComparatorCodeLUT.h @@ -14,8 +14,8 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DataFormats/CSCDigi/interface/CSCConstants.h" #include "DataFormats/CSCDigi/interface/CSCCLCTDigi.h" -#include "L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h" #include "L1Trigger/CSCTriggerPrimitives/interface/CSCPatternBank.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h" #include #include @@ -29,6 +29,8 @@ class ComparatorCodeLUT { // constructor ComparatorCodeLUT(const edm::ParameterSet& conf); + void setESLookupTables(const CSCL1TPLookupTableCCLUT* conf); + // runs the CCLUT procedure void run(CSCCLCTDigi& digi, unsigned numCFEBs) const; @@ -44,17 +46,11 @@ class ComparatorCodeLUT { // actual LUT used CSCPatternBank::LCTPatterns clct_pattern_ = {}; - std::vector positionLUTFiles_; - std::vector slopeLUTFiles_; - std::vector patternConversionLUTFiles_; - - // unique pointers to the luts - std::array, CSCConstants::NUM_CLCT_PATTERNS_RUN3> lutpos_; - std::array, CSCConstants::NUM_CLCT_PATTERNS_RUN3> lutslope_; - std::array, CSCConstants::NUM_CLCT_PATTERNS_RUN3> lutpatconv_; - // verbosity level unsigned infoV_; + + // access to lookup tables via eventsetup + const CSCL1TPLookupTableCCLUT* lookupTableCCLUT_; }; #endif diff --git a/L1Trigger/CSCTriggerPrimitives/interface/GEMClusterProcessor.h b/L1Trigger/CSCTriggerPrimitives/interface/GEMClusterProcessor.h index 893f4425bfb80..2afcdf887aa1b 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/GEMClusterProcessor.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/GEMClusterProcessor.h @@ -12,7 +12,8 @@ #include "DataFormats/GEMDigi/interface/GEMPadDigiClusterCollection.h" #include "DataFormats/GEMDigi/interface/GEMCoPadDigi.h" #include "L1Trigger/CSCTriggerPrimitives/interface/GEMInternalCluster.h" -#include "L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" #include @@ -41,6 +42,10 @@ class GEMClusterProcessor { bool hasGE21Geometry16Partitions() const { return hasGE21Geometry16Partitions_; } + void setESLookupTables(const CSCL1TPLookupTableME11ILT* conf); + + void setESLookupTables(const CSCL1TPLookupTableME21ILT* conf); + private: // put coincidence clusters in GEMInternalCluster vector void addCoincidenceClusters(const GEMPadDigiClusterCollection*); @@ -69,52 +74,8 @@ class GEMClusterProcessor { // output collection std::vector clusters_; - // strings to paths of LUTs - std::vector padToHsME1aFiles_; - std::vector padToHsME1bFiles_; - std::vector padToHsME21Files_; - - std::vector padToEsME1aFiles_; - std::vector padToEsME1bFiles_; - std::vector padToEsME21Files_; - - std::vector rollToMaxWgME11Files_; - std::vector rollToMinWgME11Files_; - std::vector rollToMaxWgME21Files_; - std::vector rollToMinWgME21Files_; - - // unique pointers to the luts - std::unique_ptr GEMCSCLUT_pad_hs_ME1a_even_; - std::unique_ptr GEMCSCLUT_pad_hs_ME1a_odd_; - std::unique_ptr GEMCSCLUT_pad_hs_ME1b_even_; - std::unique_ptr GEMCSCLUT_pad_hs_ME1b_odd_; - std::unique_ptr GEMCSCLUT_pad_hs_ME21_even_; - std::unique_ptr GEMCSCLUT_pad_hs_ME21_odd_; - - std::unique_ptr GEMCSCLUT_pad_es_ME1a_even_; - std::unique_ptr GEMCSCLUT_pad_es_ME1a_odd_; - std::unique_ptr GEMCSCLUT_pad_es_ME1b_even_; - std::unique_ptr GEMCSCLUT_pad_es_ME1b_odd_; - std::unique_ptr GEMCSCLUT_pad_es_ME21_even_; - std::unique_ptr GEMCSCLUT_pad_es_ME21_odd_; - - std::unique_ptr GEMCSCLUT_roll_l1_max_wg_ME11_even_; - std::unique_ptr GEMCSCLUT_roll_l1_max_wg_ME11_odd_; - std::unique_ptr GEMCSCLUT_roll_l1_min_wg_ME11_even_; - std::unique_ptr GEMCSCLUT_roll_l1_min_wg_ME11_odd_; - std::unique_ptr GEMCSCLUT_roll_l1_max_wg_ME21_even_; - std::unique_ptr GEMCSCLUT_roll_l1_max_wg_ME21_odd_; - std::unique_ptr GEMCSCLUT_roll_l1_min_wg_ME21_even_; - std::unique_ptr GEMCSCLUT_roll_l1_min_wg_ME21_odd_; - - std::unique_ptr GEMCSCLUT_roll_l2_max_wg_ME11_even_; - std::unique_ptr GEMCSCLUT_roll_l2_max_wg_ME11_odd_; - std::unique_ptr GEMCSCLUT_roll_l2_min_wg_ME11_even_; - std::unique_ptr GEMCSCLUT_roll_l2_min_wg_ME11_odd_; - std::unique_ptr GEMCSCLUT_roll_l2_max_wg_ME21_even_; - std::unique_ptr GEMCSCLUT_roll_l2_max_wg_ME21_odd_; - std::unique_ptr GEMCSCLUT_roll_l2_min_wg_ME21_even_; - std::unique_ptr GEMCSCLUT_roll_l2_min_wg_ME21_odd_; + const CSCL1TPLookupTableME11ILT* lookupTableME11ILT_; + const CSCL1TPLookupTableME21ILT* lookupTableME21ILT_; }; #endif diff --git a/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.cc b/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.cc index a8a0377b67958..7efcffbe042ea 100644 --- a/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.cc +++ b/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.cc @@ -49,6 +49,7 @@ CSCTriggerPrimitivesProducer::CSCTriggerPrimitivesProducer(const edm::ParameterS // check whether you need to run the integrated local triggers const edm::ParameterSet commonParam(conf.getParameter("commonParam")); + runCCLUT_ = commonParam.getParameter("runCCLUT"); runME11ILT_ = commonParam.getParameter("runME11ILT"); runME21ILT_ = commonParam.getParameter("runME21ILT"); @@ -59,6 +60,9 @@ CSCTriggerPrimitivesProducer::CSCTriggerPrimitivesProducer(const edm::ParameterS cscToken_ = esConsumes(); gemToken_ = esConsumes(); pBadChambersToken_ = esConsumes(); + pLookupTableCCLUTToken_ = esConsumes(); + pLookupTableME11ILTToken_ = esConsumes(); + pLookupTableME21ILTToken_ = esConsumes(); confToken_ = esConsumes(); // register what this produces @@ -104,6 +108,36 @@ void CSCTriggerPrimitivesProducer::produce(edm::Event& ev, const edm::EventSetup // Find conditions data for bad chambers. edm::ESHandle pBadChambers = setup.getHandle(pBadChambersToken_); + if (runCCLUT_) { + edm::ESHandle conf = setup.getHandle(pLookupTableCCLUTToken_); + if (conf.product() == nullptr) { + edm::LogError("CSCTriggerPrimitivesProducer") + << "Failed to find a CSCL1TPLookupTableCCLUTRcd in EventSetup with runCCLUT_ on"; + return; + } + builder_->setESLookupTables(conf.product()); + } + + if (runME11ILT_) { + edm::ESHandle conf = setup.getHandle(pLookupTableME11ILTToken_); + if (conf.product() == nullptr) { + edm::LogError("CSCTriggerPrimitivesProducer") + << "Failed to find a CSCL1TPLookupTableME11ILTRcd in EventSetup with runME11ILT_ on"; + return; + } + builder_->setESLookupTables(conf.product()); + } + + if (runME21ILT_) { + edm::ESHandle conf = setup.getHandle(pLookupTableME21ILTToken_); + if (conf.product() == nullptr) { + edm::LogError("CSCTriggerPrimitivesProducer") + << "Failed to find a CSCL1TPLookupTableME21ILTRcd in EventSetup with runME21ILT_ on"; + return; + } + builder_->setESLookupTables(conf.product()); + } + // If !debugParameters then get config parameters using EventSetup mechanism. // This must be done in produce() for every event and not in beginJob() // (see mail from Jim Brooke sent to hn-cms-L1TrigEmulator on July 30, 2007). diff --git a/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.h b/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.h index 208066ed4398e..f9e64b1480cc1 100644 --- a/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.h +++ b/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.h @@ -41,6 +41,9 @@ #include "DataFormats/GEMDigi/interface/GEMPadDigiClusterCollection.h" #include "L1Trigger/CSCTriggerPrimitives/interface/CSCTriggerPrimitivesBuilder.h" #include "CondFormats/DataRecord/interface/CSCBadChambersRcd.h" +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h" +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h" +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h" #include "CondFormats/DataRecord/interface/CSCDBL1TPParametersRcd.h" #include "Geometry/Records/interface/MuonGeometryRecord.h" #include "Geometry/GEMGeometry/interface/GEMGeometry.h" @@ -73,6 +76,9 @@ class CSCTriggerPrimitivesProducer : public edm::one::EDProducer<> { edm::ESGetToken cscToken_; edm::ESGetToken gemToken_; edm::ESGetToken pBadChambersToken_; + edm::ESGetToken pLookupTableCCLUTToken_; + edm::ESGetToken pLookupTableME11ILTToken_; + edm::ESGetToken pLookupTableME21ILTToken_; edm::ESGetToken confToken_; // switch to force the use of parameters from config file rather then from DB bool debugParameters_; @@ -88,6 +94,7 @@ class CSCTriggerPrimitivesProducer : public edm::one::EDProducer<> { bool keepShowers_; // switch to enable the integrated local triggers in ME11 and ME21 + bool runCCLUT_; bool runME11ILT_; bool runME21ILT_; }; diff --git a/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py b/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py index db054f871a288..67ce4f509b956 100644 --- a/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py +++ b/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py @@ -10,7 +10,6 @@ from L1Trigger.CSCTriggerPrimitives.params.clctParams import clctPSets from L1Trigger.CSCTriggerPrimitives.params.tmbParams import tmbPSets from L1Trigger.CSCTriggerPrimitives.params.auxiliaryParams import auxPSets -from L1Trigger.CSCTriggerPrimitives.params.cclutParams import cclutParams from L1Trigger.CSCTriggerPrimitives.params.gemcscParams import gemcscPSets from L1Trigger.CSCTriggerPrimitives.params.showerParams import showerPSet diff --git a/L1Trigger/CSCTriggerPrimitives/python/params/cclutParams.py b/L1Trigger/CSCTriggerPrimitives/python/params/cclutParams.py deleted file mode 100644 index 59058fd52ec7a..0000000000000 --- a/L1Trigger/CSCTriggerPrimitives/python/params/cclutParams.py +++ /dev/null @@ -1,26 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -## LUTs for the Run-3 CSC trigger -cclutParams = cms.PSet( - positionLUTFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat0_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat1_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat2_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat3_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat4_v1.txt" - ), - slopeLUTFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat0_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat1_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat2_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat3_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat4_v1.txt" - ), - patternConversionLUTFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePatternConversionLUT_pat0_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePatternConversionLUT_pat1_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePatternConversionLUT_pat2_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePatternConversionLUT_pat3_v1.txt", - "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePatternConversionLUT_pat4_v1.txt" - ), -) diff --git a/L1Trigger/CSCTriggerPrimitives/python/params/gemcscParams.py b/L1Trigger/CSCTriggerPrimitives/python/params/gemcscParams.py index 6549bf6aa5bec..96747607e171c 100644 --- a/L1Trigger/CSCTriggerPrimitives/python/params/gemcscParams.py +++ b/L1Trigger/CSCTriggerPrimitives/python/params/gemcscParams.py @@ -10,115 +10,7 @@ copadParamGE21 = copadParamGE11.clone() -## LUTs for the Run-3 GEM-CSC integrated local trigger -gemcscParams = cms.PSet( - - ## convert pad number to 1/2-strip in ME1a - padToHsME1aFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1a_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1a_odd.txt", - ), - ## convert pad number to 1/2-strip in ME1b - padToHsME1bFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1b_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1b_odd.txt", - ), - ## convert pad number to 1/2-strip in ME21 - padToHsME21Files = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME21_odd.txt", - ), - ## convert pad number to 1/8-strip in ME1a - padToEsME1aFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1a_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1a_odd.txt", - ), - ## convert pad number to 1/8-strip in ME1b - padToEsME1bFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1b_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1b_odd.txt", - ), - ## convert pad number to 1/8-strip in ME21 - padToEsME21Files = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME21_odd.txt", - ), - ## convert eta partition to minimum wiregroup in ME11 - rollToMinWgME11Files = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME11_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME11_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME11_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME11_odd.txt", - ), - ## convert eta partition to maximum wiregroup in ME11 - rollToMaxWgME11Files = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME11_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME11_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME11_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME11_odd.txt", - ), - ## convert eta partition to minimum wiregroup in ME21 - rollToMinWgME21Files = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME21_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME21_odd.txt", - ), - ## convert eta partition to maximum wiregroup in ME21 - rollToMaxWgME21Files = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME21_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME21_odd.txt", - ), - # lookup tables for the GEM-CSC slope correction - gemCscSlopeCorrectionFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_even_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_even_GE11_layer2.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_odd_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_odd_GE11_layer2.txt", - ), - # lookup tables for the GEM-CSC slope correction - gemCscSlopeCosiFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_even_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_odd_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_even_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_odd_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_even_GE11_layer2.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_odd_GE11_layer2.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_even_GE11_layer2.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_odd_GE11_layer2.txt", - ), - # lookup tables for the GEM-CSC slope correction - gemCscSlopeCosiCorrectionFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_even_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_even_GE11_layer2.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_odd_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_odd_GE11_layer2.txt", - ), - # convert differences in 1/8-strip numbers between GEM and CSC to Run-3 slopes - esDiffToSlopeME1aFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1a_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1a_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1a_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1a_odd.txt", - ), - esDiffToSlopeME1bFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1b_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1b_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1b_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1b_odd.txt", - ), - esDiffToSlopeME21Files = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME21_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME21_odd.txt", - ), -) - gemcscPSets = cms.PSet( - gemcscParams.clone(), copadParamGE11 = copadParamGE11.clone(), copadParamGE21 = copadParamGE21.clone(), ) diff --git a/L1Trigger/CSCTriggerPrimitives/python/params/tmbParams.py b/L1Trigger/CSCTriggerPrimitives/python/params/tmbParams.py index 740bfd7e4b0c6..c076776ba5192 100644 --- a/L1Trigger/CSCTriggerPrimitives/python/params/tmbParams.py +++ b/L1Trigger/CSCTriggerPrimitives/python/params/tmbParams.py @@ -105,31 +105,6 @@ dropLowQualityALCTsNoGEMs = True, ) -# LUTs to map wiregroup onto min and max half-strip number that it crosses in ME1/1 -wgCrossHsME11Params = cms.PSet( - wgCrossHsME1aFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/ME11/CSCLUT_wg_min_hs_ME1a.txt", - "L1Trigger/CSCTriggerPrimitives/data/ME11/CSCLUT_wg_max_hs_ME1a.txt", - ), - wgCrossHsME1aGangedFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/ME11/CSCLUT_wg_min_hs_ME1a_ganged.txt", - "L1Trigger/CSCTriggerPrimitives/data/ME11/CSCLUT_wg_max_hs_ME1a_ganged.txt", - ), - wgCrossHsME1bFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/ME11/CSCLUT_wg_min_hs_ME1b.txt", - "L1Trigger/CSCTriggerPrimitives/data/ME11/CSCLUT_wg_max_hs_ME1b.txt", - ) -) - -# LUTs with correspondence between ALCT-CLCT combination -# code and the resulting best/second lct1 -lctCodeParams = cms.PSet( - lctCodeFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/LCTCode/CSCLUT_code_to_bestLCT.txt", - "L1Trigger/CSCTriggerPrimitives/data/LCTCode/CSCLUT_code_to_secondLCT.txt", - ) -) - tmbPSets = cms.PSet( tmbPhase1 = tmbPhase1.clone(), tmbPhase2 = tmbPhase2.clone(), diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCALCTCrossCLCT.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCALCTCrossCLCT.cc index 4a6db6ae749d2..150c3ce37adf9 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCALCTCrossCLCT.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCALCTCrossCLCT.cc @@ -1,61 +1,36 @@ #include "L1Trigger/CSCTriggerPrimitives/interface/CSCALCTCrossCLCT.h" -#include "L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h" #include "DataFormats/CSCDigi/interface/CSCConstants.h" #include "DataFormats/CSCDigi/interface/CSCALCTDigi.h" #include "DataFormats/CSCDigi/interface/CSCCLCTDigi.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +// LUTs to map wiregroup onto min and max half-strip number that it crosses in ME1/1 +const std::vector CSCALCTCrossCLCT::wg_min_hs_ME1a_ = { + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; +const std::vector CSCALCTCrossCLCT::wg_max_hs_ME1a_ = { + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 205, 189, 167, 150, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; +const std::vector CSCALCTCrossCLCT::wg_min_hs_ME1a_ganged_ = { + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; +const std::vector CSCALCTCrossCLCT::wg_max_hs_ME1a_ganged_ = { + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 150, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; +const std::vector CSCALCTCrossCLCT::wg_min_hs_ME1b_ = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 100, 73, 47, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +const std::vector CSCALCTCrossCLCT::wg_max_hs_ME1b_ = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 105, 93, 78, 63}; + CSCALCTCrossCLCT::CSCALCTCrossCLCT( unsigned endcap, unsigned station, unsigned ring, bool ignoreAlctCrossClct, const edm::ParameterSet& conf) : endcap_(endcap), station_(station), ring_(ring) { const auto& commonParams = conf.getParameter("commonParam"); gangedME1a_ = commonParams.getParameter("gangedME1a"); ignoreAlctCrossClct_ = ignoreAlctCrossClct; - - if (!ignoreAlctCrossClct_) { - const edm::ParameterSet me11luts(conf.getParameter("wgCrossHsME11Params")); - wgCrossHsME1aFiles_ = me11luts.getParameter>("wgCrossHsME1aFiles"); - wgCrossHsME1aGangedFiles_ = me11luts.getParameter>("wgCrossHsME1aGangedFiles"); - wgCrossHsME1bFiles_ = me11luts.getParameter>("wgCrossHsME1bFiles"); - wg_cross_min_hs_ME1a_ = std::make_unique(wgCrossHsME1aFiles_[0]); - wg_cross_max_hs_ME1a_ = std::make_unique(wgCrossHsME1aFiles_[1]); - wg_cross_min_hs_ME1a_ganged_ = std::make_unique(wgCrossHsME1aGangedFiles_[0]); - wg_cross_max_hs_ME1a_ganged_ = std::make_unique(wgCrossHsME1aGangedFiles_[1]); - wg_cross_min_hs_ME1b_ = std::make_unique(wgCrossHsME1bFiles_[0]); - wg_cross_max_hs_ME1b_ = std::make_unique(wgCrossHsME1bFiles_[1]); - } -} - -void CSCALCTCrossCLCT::calculateLCTCodes(const CSCALCTDigi& bestALCT, - const CSCCLCTDigi& bestCLCT, - const CSCALCTDigi& secondALCT, - const CSCCLCTDigi& secondCLCT, - unsigned& bestLCTCode, - unsigned& secondLCTCode) const { - // Each of these calls should return "1" when the ALCT and CLCT are valid. - const bool ok11 = doesALCTCrossCLCT(bestALCT, bestCLCT); - const bool ok12 = doesALCTCrossCLCT(bestALCT, secondCLCT); - const bool ok21 = doesALCTCrossCLCT(secondALCT, bestCLCT); - const bool ok22 = doesALCTCrossCLCT(secondALCT, secondCLCT); - - /* - With these okxx, we now calculate a 4-bit code that determines - the best and second LCT combinations. - */ - - const unsigned code = (ok11 << 3) | (ok12 << 2) | (ok21 << 1) | (ok22); - - bestLCTCode = code_to_best_lct_->lookup(code); - secondLCTCode = code_to_second_lct_->lookup(code); - - edm::LogInfo("CSCALCTCrossCLCT") << "Calculate LCT combination code" << std::endl - << "ALCT1: " << bestALCT << std::endl - << "ALCT2: " << secondALCT << std::endl - << "CLCT1: " << bestCLCT << std::endl - << "CLCT2: " << secondCLCT << std::endl - << "LCT combination code: " << code << std::endl - << "LCT1: " << bestLCTCode << std::endl - << "LCT1: " << secondLCTCode << std::endl; } bool CSCALCTCrossCLCT::doesALCTCrossCLCT(const CSCALCTDigi& a, const CSCCLCTDigi& c) const { @@ -76,12 +51,16 @@ bool CSCALCTCrossCLCT::doesALCTCrossCLCT(const CSCALCTDigi& a, const CSCCLCTDigi } bool CSCALCTCrossCLCT::doesWiregroupCrossHalfStrip(int wiregroup, int halfstrip) const { - const int min_hs_ME1a = wg_cross_min_hs_ME1a_->lookup(wiregroup); - const int max_hs_ME1a = wg_cross_max_hs_ME1a_->lookup(wiregroup); - const int min_hs_ME1a_ganged = wg_cross_min_hs_ME1a_ganged_->lookup(wiregroup); - const int max_hs_ME1a_ganged = wg_cross_max_hs_ME1a_ganged_->lookup(wiregroup); - const int min_hs_ME1b = wg_cross_min_hs_ME1b_->lookup(wiregroup); - const int max_hs_ME1b = wg_cross_max_hs_ME1b_->lookup(wiregroup); + // sanity-check for invalid wiregroups + if (wiregroup < 0 or wiregroup >= CSCConstants::NUM_WIREGROUPS_ME11) + return false; + + const int min_hs_ME1a = wg_min_hs_ME1a_[wiregroup]; + const int max_hs_ME1a = wg_max_hs_ME1a_[wiregroup]; + const int min_hs_ME1a_ganged = wg_min_hs_ME1a_ganged_[wiregroup]; + const int max_hs_ME1a_ganged = wg_max_hs_ME1a_ganged_[wiregroup]; + const int min_hs_ME1b = wg_min_hs_ME1b_[wiregroup]; + const int max_hs_ME1b = wg_max_hs_ME1b_[wiregroup]; // ME1/a half-strip starts at 128 if (halfstrip > CSCConstants::MAX_HALF_STRIP_ME1B) { diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMatcher.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMatcher.cc index c4baf765e0146..20b13ad12bfd1 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMatcher.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMatcher.cc @@ -1,5 +1,4 @@ #include "L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h" -#include "L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h" #include "L1Trigger/CSCTriggerPrimitives/interface/GEMInternalCluster.h" #include "DataFormats/CSCDigi/interface/CSCConstants.h" #include "DataFormats/CSCDigi/interface/CSCALCTDigi.h" @@ -29,56 +28,11 @@ CSCGEMMatcher::CSCGEMMatcher( mitigateSlopeByCosi_ = tmbParams.getParameter("mitigateSlopeByCosi"); assign_gem_csc_bending_ = tmbParams.getParameter("assignGEMCSCBending"); +} - if (mitigateSlopeByCosi_) { - gemCscSlopeCosiFiles_ = conf.getParameter>("gemCscSlopeCosiFiles"); - - gem_csc_slope_cosi_2to1_L1_ME11_even_ = std::make_unique(gemCscSlopeCosiFiles_[0]); - gem_csc_slope_cosi_2to1_L1_ME11_odd_ = std::make_unique(gemCscSlopeCosiFiles_[1]); - gem_csc_slope_cosi_3to1_L1_ME11_even_ = std::make_unique(gemCscSlopeCosiFiles_[2]); - gem_csc_slope_cosi_3to1_L1_ME11_odd_ = std::make_unique(gemCscSlopeCosiFiles_[3]); - - gemCscSlopeCosiCorrectionFiles_ = conf.getParameter>("gemCscSlopeCosiCorrectionFiles"); - - gem_csc_slope_cosi_corr_L1_ME11_even_ = std::make_unique(gemCscSlopeCosiCorrectionFiles_[0]); - gem_csc_slope_cosi_corr_L2_ME11_even_ = std::make_unique(gemCscSlopeCosiCorrectionFiles_[1]); - gem_csc_slope_cosi_corr_L1_ME11_odd_ = std::make_unique(gemCscSlopeCosiCorrectionFiles_[2]); - gem_csc_slope_cosi_corr_L2_ME11_odd_ = std::make_unique(gemCscSlopeCosiCorrectionFiles_[3]); - } else { - gemCscSlopeCorrectionFiles_ = conf.getParameter>("gemCscSlopeCorrectionFiles"); - - gem_csc_slope_corr_L1_ME11_even_ = std::make_unique(gemCscSlopeCorrectionFiles_[0]); - gem_csc_slope_corr_L2_ME11_even_ = std::make_unique(gemCscSlopeCorrectionFiles_[1]); - gem_csc_slope_corr_L1_ME11_odd_ = std::make_unique(gemCscSlopeCorrectionFiles_[2]); - gem_csc_slope_corr_L2_ME11_odd_ = std::make_unique(gemCscSlopeCorrectionFiles_[3]); - } - - if (assign_gem_csc_bending_) { - if (station_ == 1) { - esDiffToSlopeME1aFiles_ = conf.getParameter>("esDiffToSlopeME1aFiles"); - esDiffToSlopeME1bFiles_ = conf.getParameter>("esDiffToSlopeME1bFiles"); - - es_diff_slope_L1_ME1a_even_ = std::make_unique(esDiffToSlopeME1aFiles_[0]); - es_diff_slope_L1_ME1a_odd_ = std::make_unique(esDiffToSlopeME1aFiles_[1]); - es_diff_slope_L2_ME1a_even_ = std::make_unique(esDiffToSlopeME1aFiles_[2]); - es_diff_slope_L2_ME1a_odd_ = std::make_unique(esDiffToSlopeME1aFiles_[3]); - - es_diff_slope_L1_ME1b_even_ = std::make_unique(esDiffToSlopeME1bFiles_[0]); - es_diff_slope_L1_ME1b_odd_ = std::make_unique(esDiffToSlopeME1bFiles_[1]); - es_diff_slope_L2_ME1b_even_ = std::make_unique(esDiffToSlopeME1bFiles_[2]); - es_diff_slope_L2_ME1b_odd_ = std::make_unique(esDiffToSlopeME1bFiles_[3]); - } - - if (station_ == 2) { - esDiffToSlopeME21Files_ = conf.getParameter>("esDiffToSlopeME21Files"); +void CSCGEMMatcher::setESLookupTables(const CSCL1TPLookupTableME11ILT* conf) { lookupTableME11ILT_ = conf; } - es_diff_slope_L1_ME21_even_ = std::make_unique(esDiffToSlopeME21Files_[0]); - es_diff_slope_L1_ME21_odd_ = std::make_unique(esDiffToSlopeME21Files_[1]); - es_diff_slope_L2_ME21_even_ = std::make_unique(esDiffToSlopeME21Files_[2]); - es_diff_slope_L2_ME21_odd_ = std::make_unique(esDiffToSlopeME21Files_[3]); - } - } -} +void CSCGEMMatcher::setESLookupTables(const CSCL1TPLookupTableME21ILT* conf) { lookupTableME21ILT_ = conf; } unsigned CSCGEMMatcher::calculateGEMCSCBending(const CSCCLCTDigi& clct, const GEMInternalCluster& cluster) const { // difference in 1/8-strip number @@ -90,14 +44,14 @@ unsigned CSCGEMMatcher::calculateGEMCSCBending(const CSCCLCTDigi& clct, const GE if (station_ == 2) { if (isEven_) { if (cluster.id().layer() == 1) - slope = es_diff_slope_L1_ME21_even_->lookup(diff); + slope = lookupTableME21ILT_->es_diff_slope_L1_ME21_even(diff); else - slope = es_diff_slope_L2_ME21_even_->lookup(diff); + slope = lookupTableME21ILT_->es_diff_slope_L2_ME21_even(diff); } else { if (cluster.id().layer() == 1) - slope = es_diff_slope_L1_ME21_odd_->lookup(diff); + slope = lookupTableME21ILT_->es_diff_slope_L1_ME21_odd(diff); else - slope = es_diff_slope_L2_ME21_odd_->lookup(diff); + slope = lookupTableME21ILT_->es_diff_slope_L2_ME21_odd(diff); } } @@ -106,26 +60,26 @@ unsigned CSCGEMMatcher::calculateGEMCSCBending(const CSCCLCTDigi& clct, const GE if (station_ == 1 and isME1a) { if (isEven_) { if (cluster.id().layer() == 1) - slope = es_diff_slope_L1_ME1a_even_->lookup(diff); + slope = lookupTableME11ILT_->es_diff_slope_L1_ME1a_even(diff); else - slope = es_diff_slope_L2_ME1a_even_->lookup(diff); + slope = lookupTableME11ILT_->es_diff_slope_L2_ME1a_even(diff); } else { if (cluster.id().layer() == 1) - slope = es_diff_slope_L1_ME1a_odd_->lookup(diff); + slope = lookupTableME11ILT_->es_diff_slope_L1_ME1a_odd(diff); else - slope = es_diff_slope_L2_ME1a_odd_->lookup(diff); + slope = lookupTableME11ILT_->es_diff_slope_L2_ME1a_odd(diff); } } else { if (isEven_) { if (cluster.id().layer() == 1) - slope = es_diff_slope_L1_ME1b_even_->lookup(diff); + slope = lookupTableME11ILT_->es_diff_slope_L1_ME1b_even(diff); else - slope = es_diff_slope_L2_ME1b_even_->lookup(diff); + slope = lookupTableME11ILT_->es_diff_slope_L2_ME1b_even(diff); } else { if (cluster.id().layer() == 1) - slope = es_diff_slope_L1_ME1b_odd_->lookup(diff); + slope = lookupTableME11ILT_->es_diff_slope_L1_ME1b_odd(diff); else - slope = es_diff_slope_L2_ME1b_odd_->lookup(diff); + slope = lookupTableME11ILT_->es_diff_slope_L2_ME1b_odd(diff); } } @@ -458,16 +412,16 @@ uint16_t CSCGEMMatcher::mitigatedSlopeByConsistency(const CSCCLCTDigi& clct) con //need to look up in table 2->1 else if (cosi == 2) { if (chamber_ % 2 == 0) - return gem_csc_slope_cosi_2to1_L1_ME11_even_->lookup(clct.getSlope()); + return lookupTableME11ILT_->CSC_slope_cosi_2to1_L1_ME11_even(clct.getSlope()); else - return gem_csc_slope_cosi_2to1_L1_ME11_odd_->lookup(clct.getSlope()); + return lookupTableME11ILT_->CSC_slope_cosi_2to1_L1_ME11_odd(clct.getSlope()); } //need to look up in table 3->1 else if (cosi == 3) { if (chamber_ % 2 == 0) - return gem_csc_slope_cosi_3to1_L1_ME11_even_->lookup(clct.getSlope()); + return lookupTableME11ILT_->CSC_slope_cosi_3to1_L1_ME11_even(clct.getSlope()); else - return gem_csc_slope_cosi_3to1_L1_ME11_odd_->lookup(clct.getSlope()); + return lookupTableME11ILT_->CSC_slope_cosi_3to1_L1_ME11_odd(clct.getSlope()); } //just to avoid compiler errors an error code else { @@ -483,27 +437,27 @@ int CSCGEMMatcher::CSCGEMSlopeCorrector(bool isL1orCoincidence, int cscSlope) co //determine cosi-based slope correction if (chamber_ % 2 == 0) { if (isL1orCoincidence) - SlopeShift = gem_csc_slope_cosi_corr_L1_ME11_even_->lookup(std::abs(cscSlope)); + SlopeShift = lookupTableME11ILT_->CSC_slope_cosi_corr_L1_ME11_even(std::abs(cscSlope)); else - SlopeShift = gem_csc_slope_cosi_corr_L2_ME11_even_->lookup(std::abs(cscSlope)); + SlopeShift = lookupTableME11ILT_->CSC_slope_cosi_corr_L2_ME11_even(std::abs(cscSlope)); } else { if (isL1orCoincidence) - SlopeShift = gem_csc_slope_cosi_corr_L1_ME11_odd_->lookup(std::abs(cscSlope)); + SlopeShift = lookupTableME11ILT_->CSC_slope_cosi_corr_L1_ME11_odd(std::abs(cscSlope)); else - SlopeShift = gem_csc_slope_cosi_corr_L2_ME11_odd_->lookup(std::abs(cscSlope)); + SlopeShift = lookupTableME11ILT_->CSC_slope_cosi_corr_L2_ME11_odd(std::abs(cscSlope)); } } else { //determine shift by slope correction if (chamber_ % 2 == 0) { if (isL1orCoincidence) - SlopeShift = gem_csc_slope_corr_L1_ME11_even_->lookup(std::abs(cscSlope)); + SlopeShift = lookupTableME11ILT_->CSC_slope_corr_L1_ME11_even(std::abs(cscSlope)); else - SlopeShift = gem_csc_slope_corr_L2_ME11_even_->lookup(std::abs(cscSlope)); + SlopeShift = lookupTableME11ILT_->CSC_slope_corr_L2_ME11_even(std::abs(cscSlope)); } else { if (isL1orCoincidence) - SlopeShift = gem_csc_slope_corr_L1_ME11_odd_->lookup(std::abs(cscSlope)); + SlopeShift = lookupTableME11ILT_->CSC_slope_corr_L1_ME11_odd(std::abs(cscSlope)); else - SlopeShift = gem_csc_slope_corr_L2_ME11_odd_->lookup(std::abs(cscSlope)); + SlopeShift = lookupTableME11ILT_->CSC_slope_corr_L2_ME11_odd(std::abs(cscSlope)); } } return std::round(SlopeShift * SlopeSign * endcap_); diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboard.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboard.cc index acd00495b0068..bc550b5b23273 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboard.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboard.cc @@ -42,6 +42,16 @@ CSCGEMMotherboard::CSCGEMMotherboard(unsigned endcap, clusterProc_ = std::make_shared(theRegion, theStation, theChamber, conf); cscGEMMatcher_ = std::make_unique(theRegion, theStation, theChamber, tmbParams_, conf); + + // set the lookup tables for coordinate conversion and matching + if (runME11ILT_) { + clusterProc_->setESLookupTables(lookupTableME11ILT_); + cscGEMMatcher_->setESLookupTables(lookupTableME11ILT_); + } + if (runME21ILT_) { + clusterProc_->setESLookupTables(lookupTableME21ILT_); + cscGEMMatcher_->setESLookupTables(lookupTableME21ILT_); + } } CSCGEMMotherboard::~CSCGEMMotherboard() {} diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCLUTReader.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCLUTReader.cc deleted file mode 100644 index ec8923b970177..0000000000000 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCLUTReader.cc +++ /dev/null @@ -1,171 +0,0 @@ -#include "L1Trigger/CSCTriggerPrimitives/interface/CSCLUTReader.h" -#include "FWCore/Utilities/interface/Exception.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -CSCLUTReader::CSCLUTReader(const std::string& fname) - : fname_(fname), - nrBitsAddress_(0), - nrBitsData_(0), - addressMask_(0), - dataMask_(0), - data_(), - m_codeInWidth(12), - m_outWidth(32) { - if (fname != std::string("")) { - load(fname); - } else { - initialize(); - } -} - -// I/O functions -void CSCLUTReader::save(std::ofstream& output) { write(output); } - -float CSCLUTReader::data(unsigned int address) const { - return (address & addressMask_) < data_.size() ? data_[address] : 0; -} - -int CSCLUTReader::load(const std::string& inFileName) { - std::ifstream fstream; - fstream.open(edm::FileInPath(inFileName.c_str()).fullPath()); - if (!fstream.good()) { - fstream.close(); - edm::LogError("CSCLUTReader") << "Failed to open LUT file: " << inFileName; - } - int readCode = read(fstream); - - m_initialized = true; - fstream.close(); - - return readCode; -} - -float CSCLUTReader::lookup(int code) const { - if (m_initialized) { - return lookupPacked(code); - } else { - edm::LogError("CSCLUTReader") << "LUT not initialized. " << fname_; - return 0; - } -} - -float CSCLUTReader::lookupPacked(const int input) const { - if (m_initialized) { - return data((unsigned int)input); - } else { - edm::LogError("CSCLUTReader") << "If you're not loading a LUT from file you need to implement lookupPacked."; - return 0; - } -} - -void CSCLUTReader::initialize() { - if (empty()) { - std::stringstream stream; - stream << "#
V1 " << m_codeInWidth << " " << m_outWidth << "
" << std::endl; - for (int in = 0; in < (1 << m_codeInWidth); ++in) { - int out = lookup(in); - stream << in << " " << out << std::endl; - } - read(stream); - } - m_initialized = true; -} - -unsigned CSCLUTReader::checkedInput(unsigned in, unsigned maxWidth) const { - unsigned maxIn = (1 << maxWidth) - 1; - return (in < maxIn ? in : maxIn); -} - -int CSCLUTReader::read(std::istream& stream) { - data_.clear(); - - int readHeaderCode = readHeader(stream); - if (readHeaderCode != SUCCESS) { - edm::LogError("CSCLUTReader") << "Failed to read header code. " << fname_; - return readHeaderCode; - } - - std::vector > entries; - unsigned int maxAddress = addressMask_; - std::string line; - - while (std::getline(stream, line)) { - line.erase(std::find(line.begin(), line.end(), '#'), line.end()); //ignore comments - std::istringstream lineStream(line); - std::pair entry; - while (lineStream >> entry.first >> entry.second) { - entry.first &= addressMask_; - // entry.second &= dataMask_; - entries.push_back(entry); - if (entry.first > maxAddress || maxAddress == addressMask_) - maxAddress = entry.first; - } - } - std::sort(entries.begin(), entries.end()); - if (entries.empty()) { - //log the error we read nothing - return NO_ENTRIES; - } - //this check is redundant as dups are also picked up by the next check but might make for easier debugging - if (std::adjacent_find(entries.begin(), entries.end(), [](auto const& a, auto const& b) { - return a.first == b.first; - }) != entries.end()) { - //log the error that we have duplicate addresses once masked - return DUP_ENTRIES; - } - if (entries.front().first != 0 || - std::adjacent_find(entries.begin(), entries.end(), [](auto const& a, auto const& b) { - return a.first + 1 != b.first; - }) != entries.end()) { - //log the error that we have a missing entry - return MISS_ENTRIES; - } - - if (maxAddress != std::numeric_limits::max()) - data_.resize(maxAddress + 1, 0); - else { - //log the error that we have more addresses than we can deal with (which is 4gb so something probably has gone wrong anyways) - return MAX_ADDRESS_OUTOFRANGE; - } - - std::transform(entries.begin(), entries.end(), data_.begin(), [](auto const& x) { return x.second; }); - return SUCCESS; -} - -void CSCLUTReader::write(std::ostream& stream) const { - stream << "#
V1 " << nrBitsAddress_ << " " << nrBitsData_ << "
" << std::endl; - for (unsigned int address = 0; address < data_.size(); address++) { - stream << (address & addressMask_) << " " << data(address) << std::endl; - } -} - -unsigned int CSCLUTReader::maxSize() const { - return addressMask_ == std::numeric_limits::max() ? addressMask_ : addressMask_ + 1; -} - -int CSCLUTReader::readHeader(std::istream& stream) { - int startPos = stream.tellg(); //we are going to reset to this position before we exit - std::string line; - while (std::getline(stream, line)) { - if (line.find("#
") == 0) { //line - std::istringstream lineStream(line); - - std::string version; //currently not doing anything with this - std::string headerField; //currently not doing anything with this - if (lineStream >> headerField >> version >> nrBitsAddress_ >> nrBitsData_) { - addressMask_ = nrBitsAddress_ != 32 ? (0x1 << nrBitsAddress_) - 1 : ~0x0; - dataMask_ = (0x1 << nrBitsData_) - 1; - stream.seekg(startPos); - return SUCCESS; - } - } - } - - nrBitsAddress_ = 0; - nrBitsData_ = 0; - addressMask_ = (0x1 << nrBitsAddress_) - 1; - dataMask_ = (0x1 << nrBitsData_) - 1; - - stream.seekg(startPos); - return NO_HEADER; -} diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc index 67a7548908179..574c7885e1b5e 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc @@ -121,6 +121,12 @@ void CSCMotherboard::setConfigParameters(const CSCDBL1TPParameters* conf) { } } +void CSCMotherboard::setESLookupTables(const CSCL1TPLookupTableCCLUT* conf) { lookupTableCCLUT_ = conf; } + +void CSCMotherboard::setESLookupTables(const CSCL1TPLookupTableME11ILT* conf) { lookupTableME11ILT_ = conf; } + +void CSCMotherboard::setESLookupTables(const CSCL1TPLookupTableME21ILT* conf) { lookupTableME21ILT_ = conf; } + void CSCMotherboard::run(const CSCWireDigiCollection* wiredc, const CSCComparatorDigiCollection* compdc) { // Step 1: Setup clear(); diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCTriggerPrimitivesBuilder.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCTriggerPrimitivesBuilder.cc index fbcd070d422f6..643f3d96b6bd1 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCTriggerPrimitivesBuilder.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCTriggerPrimitivesBuilder.cc @@ -95,6 +95,54 @@ void CSCTriggerPrimitivesBuilder::setConfigParameters(const CSCDBL1TPParameters* } } +void CSCTriggerPrimitivesBuilder::setESLookupTables(const CSCL1TPLookupTableCCLUT* conf) { + // Receives CSCL1TPLookupTableCCLUT percolated down from ESProducer. + for (int endc = min_endcap; endc <= max_endcap; endc++) { + for (int stat = min_station; stat <= max_station; stat++) { + int numsubs = ((stat == 1) ? max_subsector : 1); + for (int sect = min_sector; sect <= max_sector; sect++) { + for (int subs = min_subsector; subs <= numsubs; subs++) { + for (int cham = min_chamber; cham <= max_chamber; cham++) { + tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1]->setESLookupTables(conf); + } + } + } + } + } +} + +void CSCTriggerPrimitivesBuilder::setESLookupTables(const CSCL1TPLookupTableME11ILT* conf) { + for (int endc = min_endcap; endc <= max_endcap; endc++) { + for (int stat = min_station; stat <= max_station; stat++) { + int numsubs = ((stat == 1) ? max_subsector : 1); + for (int sect = min_sector; sect <= max_sector; sect++) { + for (int subs = min_subsector; subs <= numsubs; subs++) { + for (int cham = min_chamber; cham <= max_chamber; cham++) { + if (tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1]->id().isME11()) + tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1]->setESLookupTables(conf); + } + } + } + } + } +} + +void CSCTriggerPrimitivesBuilder::setESLookupTables(const CSCL1TPLookupTableME21ILT* conf) { + for (int endc = min_endcap; endc <= max_endcap; endc++) { + for (int stat = min_station; stat <= max_station; stat++) { + int numsubs = ((stat == 1) ? max_subsector : 1); + for (int sect = min_sector; sect <= max_sector; sect++) { + for (int subs = min_subsector; subs <= numsubs; subs++) { + for (int cham = min_chamber; cham <= max_chamber; cham++) { + if (tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1]->id().isME21()) + tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1]->setESLookupTables(conf); + } + } + } + } + } +} + void CSCTriggerPrimitivesBuilder::build(const CSCBadChambers* badChambers, const CSCWireDigiCollection* wiredc, const CSCComparatorDigiCollection* compdc, diff --git a/L1Trigger/CSCTriggerPrimitives/src/ComparatorCodeLUT.cc b/L1Trigger/CSCTriggerPrimitives/src/ComparatorCodeLUT.cc index 2b55021f244ed..73c992eee232f 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/ComparatorCodeLUT.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/ComparatorCodeLUT.cc @@ -2,19 +2,11 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" ComparatorCodeLUT::ComparatorCodeLUT(const edm::ParameterSet& conf) { - positionLUTFiles_ = conf.getParameter>("positionLUTFiles"); - slopeLUTFiles_ = conf.getParameter>("slopeLUTFiles"); - patternConversionLUTFiles_ = conf.getParameter>("patternConversionLUTFiles"); - - for (int i = 0; i < 5; ++i) { - lutpos_[i] = std::make_unique(positionLUTFiles_[i]); - lutslope_[i] = std::make_unique(slopeLUTFiles_[i]); - lutpatconv_[i] = std::make_unique(patternConversionLUTFiles_[i]); - } - clct_pattern_ = CSCPatternBank::clct_pattern_run3_; } +void ComparatorCodeLUT::setESLookupTables(const CSCL1TPLookupTableCCLUT* conf) { lookupTableCCLUT_ = conf; } + void ComparatorCodeLUT::run(CSCCLCTDigi& digi, unsigned numCFEBs) const { // print out the old CLCT for debugging if (infoV_ > 2) { @@ -67,8 +59,8 @@ void ComparatorCodeLUT::run(CSCCLCTDigi& digi, unsigned numCFEBs) const { digi.setRun3Pattern(pattern); // look-up the unsigned values - const unsigned positionCC(lutpos_[pattern]->lookup(comparatorCode)); - const unsigned slopeCC(lutslope_[pattern]->lookup(comparatorCode)); + const unsigned positionCC(lookupTableCCLUT_->cclutPosition(pattern, comparatorCode)); + const unsigned slopeCC(lookupTableCCLUT_->cclutSlope(pattern, comparatorCode)); const unsigned run2PatternCC(convertSlopeToRun2Pattern(slopeCC)); // if the slope is negative, set bending to 0 diff --git a/L1Trigger/CSCTriggerPrimitives/src/GEMClusterProcessor.cc b/L1Trigger/CSCTriggerPrimitives/src/GEMClusterProcessor.cc index 51f81ff7a026b..b36fd7cf9d182 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/GEMClusterProcessor.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/GEMClusterProcessor.cc @@ -13,35 +13,6 @@ GEMClusterProcessor::GEMClusterProcessor(int region, unsigned station, unsigned maxDeltaPad_ = copad.getParameter("maxDeltaPad"); maxDeltaRoll_ = copad.getParameter("maxDeltaRoll"); maxDeltaBX_ = copad.getParameter("maxDeltaBX"); - - padToHsME1aFiles_ = conf.getParameter>("padToHsME1aFiles"); - padToHsME1bFiles_ = conf.getParameter>("padToHsME1bFiles"); - - padToEsME1aFiles_ = conf.getParameter>("padToEsME1aFiles"); - padToEsME1bFiles_ = conf.getParameter>("padToEsME1bFiles"); - - rollToMaxWgME11Files_ = conf.getParameter>("rollToMaxWgME11Files"); - rollToMinWgME11Files_ = conf.getParameter>("rollToMinWgME11Files"); - - GEMCSCLUT_pad_hs_ME1a_even_ = std::make_unique(padToHsME1aFiles_[0]); - GEMCSCLUT_pad_hs_ME1a_odd_ = std::make_unique(padToHsME1aFiles_[1]); - GEMCSCLUT_pad_hs_ME1b_even_ = std::make_unique(padToHsME1bFiles_[0]); - GEMCSCLUT_pad_hs_ME1b_odd_ = std::make_unique(padToHsME1bFiles_[1]); - - GEMCSCLUT_pad_es_ME1a_even_ = std::make_unique(padToEsME1aFiles_[0]); - GEMCSCLUT_pad_es_ME1a_odd_ = std::make_unique(padToEsME1aFiles_[1]); - GEMCSCLUT_pad_es_ME1b_even_ = std::make_unique(padToEsME1bFiles_[0]); - GEMCSCLUT_pad_es_ME1b_odd_ = std::make_unique(padToEsME1bFiles_[1]); - - GEMCSCLUT_roll_l1_min_wg_ME11_even_ = std::make_unique(rollToMinWgME11Files_[0]); - GEMCSCLUT_roll_l1_min_wg_ME11_odd_ = std::make_unique(rollToMinWgME11Files_[1]); - GEMCSCLUT_roll_l2_min_wg_ME11_even_ = std::make_unique(rollToMinWgME11Files_[2]); - GEMCSCLUT_roll_l2_min_wg_ME11_odd_ = std::make_unique(rollToMinWgME11Files_[3]); - - GEMCSCLUT_roll_l1_max_wg_ME11_even_ = std::make_unique(rollToMaxWgME11Files_[0]); - GEMCSCLUT_roll_l1_max_wg_ME11_odd_ = std::make_unique(rollToMaxWgME11Files_[1]); - GEMCSCLUT_roll_l2_max_wg_ME11_even_ = std::make_unique(rollToMaxWgME11Files_[2]); - GEMCSCLUT_roll_l2_max_wg_ME11_odd_ = std::make_unique(rollToMaxWgME11Files_[3]); } if (station_ == 2) { @@ -52,32 +23,15 @@ GEMClusterProcessor::GEMClusterProcessor(int region, unsigned station, unsigned maxDeltaPad_ = copad.getParameter("maxDeltaPad"); maxDeltaRoll_ = copad.getParameter("maxDeltaRoll"); maxDeltaBX_ = copad.getParameter("maxDeltaBX"); - - padToHsME21Files_ = conf.getParameter>("padToHsME21Files"); - padToEsME21Files_ = conf.getParameter>("padToEsME21Files"); - - rollToMaxWgME21Files_ = conf.getParameter>("rollToMaxWgME21Files"); - rollToMinWgME21Files_ = conf.getParameter>("rollToMinWgME21Files"); - - GEMCSCLUT_pad_hs_ME21_even_ = std::make_unique(padToHsME21Files_[0]); - GEMCSCLUT_pad_hs_ME21_odd_ = std::make_unique(padToHsME21Files_[1]); - GEMCSCLUT_pad_es_ME21_even_ = std::make_unique(padToEsME21Files_[0]); - GEMCSCLUT_pad_es_ME21_odd_ = std::make_unique(padToEsME21Files_[1]); - - GEMCSCLUT_roll_l1_min_wg_ME21_even_ = std::make_unique(rollToMinWgME21Files_[0]); - GEMCSCLUT_roll_l1_min_wg_ME21_odd_ = std::make_unique(rollToMinWgME21Files_[1]); - GEMCSCLUT_roll_l2_min_wg_ME21_even_ = std::make_unique(rollToMinWgME21Files_[2]); - GEMCSCLUT_roll_l2_min_wg_ME21_odd_ = std::make_unique(rollToMinWgME21Files_[3]); - - GEMCSCLUT_roll_l1_max_wg_ME21_even_ = std::make_unique(rollToMaxWgME21Files_[0]); - GEMCSCLUT_roll_l1_max_wg_ME21_odd_ = std::make_unique(rollToMaxWgME21Files_[1]); - GEMCSCLUT_roll_l2_max_wg_ME21_even_ = std::make_unique(rollToMaxWgME21Files_[2]); - GEMCSCLUT_roll_l2_max_wg_ME21_odd_ = std::make_unique(rollToMaxWgME21Files_[3]); } } void GEMClusterProcessor::clear() { clusters_.clear(); } +void GEMClusterProcessor::setESLookupTables(const CSCL1TPLookupTableME11ILT* conf) { lookupTableME11ILT_ = conf; } + +void GEMClusterProcessor::setESLookupTables(const CSCL1TPLookupTableME21ILT* conf) { lookupTableME21ILT_ = conf; } + void GEMClusterProcessor::run(const GEMPadDigiClusterCollection* in_clusters) { // Step 1: clear the GEMInternalCluster vector clear(); @@ -265,28 +219,28 @@ void GEMClusterProcessor::doCoordinateConversion() { if (station_ == 1) { if (isEven_) { // ME1/b - layer1_pad_to_first_hs = GEMCSCLUT_pad_hs_ME1b_even_->lookup(layer1_first_pad); - layer1_pad_to_last_hs = GEMCSCLUT_pad_hs_ME1b_even_->lookup(layer1_last_pad); + layer1_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer1_first_pad); + layer1_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer1_last_pad); // ME1/a - layer1_pad_to_first_hs_me1a = GEMCSCLUT_pad_hs_ME1a_even_->lookup(layer1_first_pad); - layer1_pad_to_last_hs_me1a = GEMCSCLUT_pad_hs_ME1a_even_->lookup(layer1_last_pad); + layer1_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer1_first_pad); + layer1_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer1_last_pad); } else { // ME1/b - layer1_pad_to_first_hs = GEMCSCLUT_pad_hs_ME1b_odd_->lookup(layer1_first_pad); - layer1_pad_to_last_hs = GEMCSCLUT_pad_hs_ME1b_odd_->lookup(layer1_last_pad); + layer1_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer1_first_pad); + layer1_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer1_last_pad); // ME1/a - layer1_pad_to_first_hs_me1a = GEMCSCLUT_pad_hs_ME1a_odd_->lookup(layer1_first_pad); - layer1_pad_to_last_hs_me1a = GEMCSCLUT_pad_hs_ME1a_odd_->lookup(layer1_last_pad); + layer1_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer1_first_pad); + layer1_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer1_last_pad); } } // ME2/1 if (station_ == 2) { if (isEven_) { - layer1_pad_to_first_hs = GEMCSCLUT_pad_hs_ME21_even_->lookup(layer1_first_pad); - layer1_pad_to_last_hs = GEMCSCLUT_pad_hs_ME21_even_->lookup(layer1_last_pad); + layer1_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer1_first_pad); + layer1_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer1_last_pad); } else { - layer1_pad_to_first_hs = GEMCSCLUT_pad_hs_ME21_odd_->lookup(layer1_first_pad); - layer1_pad_to_last_hs = GEMCSCLUT_pad_hs_ME21_odd_->lookup(layer1_last_pad); + layer1_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer1_first_pad); + layer1_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer1_last_pad); } } // middle 1/2-strip @@ -314,28 +268,28 @@ void GEMClusterProcessor::doCoordinateConversion() { if (station_ == 1) { if (isEven_) { // ME1/b - layer1_pad_to_first_es = GEMCSCLUT_pad_es_ME1b_even_->lookup(layer1_first_pad); - layer1_pad_to_last_es = GEMCSCLUT_pad_es_ME1b_even_->lookup(layer1_last_pad); + layer1_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer1_first_pad); + layer1_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer1_last_pad); // ME1/a - layer1_pad_to_first_es_me1a = GEMCSCLUT_pad_es_ME1a_even_->lookup(layer1_first_pad); - layer1_pad_to_last_es_me1a = GEMCSCLUT_pad_es_ME1a_even_->lookup(layer1_last_pad); + layer1_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer1_first_pad); + layer1_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer1_last_pad); } else { // ME1/b - layer1_pad_to_first_es = GEMCSCLUT_pad_es_ME1b_odd_->lookup(layer1_first_pad); - layer1_pad_to_last_es = GEMCSCLUT_pad_es_ME1b_odd_->lookup(layer1_last_pad); + layer1_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer1_first_pad); + layer1_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer1_last_pad); // ME1/a - layer1_pad_to_first_es_me1a = GEMCSCLUT_pad_es_ME1a_odd_->lookup(layer1_first_pad); - layer1_pad_to_last_es_me1a = GEMCSCLUT_pad_es_ME1a_odd_->lookup(layer1_last_pad); + layer1_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer1_first_pad); + layer1_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer1_last_pad); } } // ME2/1 if (station_ == 2) { if (isEven_) { - layer1_pad_to_first_es = GEMCSCLUT_pad_es_ME21_even_->lookup(layer1_first_pad); - layer1_pad_to_last_es = GEMCSCLUT_pad_es_ME21_even_->lookup(layer1_last_pad); + layer1_pad_to_first_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_even(layer1_first_pad); + layer1_pad_to_last_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_even(layer1_last_pad); } else { - layer1_pad_to_first_es = GEMCSCLUT_pad_es_ME21_odd_->lookup(layer1_first_pad); - layer1_pad_to_last_es = GEMCSCLUT_pad_es_ME21_odd_->lookup(layer1_last_pad); + layer1_pad_to_first_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_odd(layer1_first_pad); + layer1_pad_to_last_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_odd(layer1_last_pad); } } // middle 1/8-strip @@ -362,22 +316,22 @@ void GEMClusterProcessor::doCoordinateConversion() { // ME1/1 if (station_ == 1) { if (isEven_) { - roll_l1_to_min_wg = GEMCSCLUT_roll_l1_min_wg_ME11_even_->lookup(roll); - roll_l1_to_max_wg = GEMCSCLUT_roll_l1_max_wg_ME11_even_->lookup(roll); + roll_l1_to_min_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_min_wg_ME11_even(roll); + roll_l1_to_max_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_max_wg_ME11_even(roll); } else { - roll_l1_to_min_wg = GEMCSCLUT_roll_l1_min_wg_ME11_odd_->lookup(roll); - roll_l1_to_max_wg = GEMCSCLUT_roll_l1_max_wg_ME11_odd_->lookup(roll); + roll_l1_to_min_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_min_wg_ME11_odd(roll); + roll_l1_to_max_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_max_wg_ME11_odd(roll); } } // ME2/1 if (station_ == 2) { if (isEven_) { - roll_l1_to_min_wg = GEMCSCLUT_roll_l1_min_wg_ME21_even_->lookup(roll); - roll_l1_to_max_wg = GEMCSCLUT_roll_l1_max_wg_ME21_even_->lookup(roll); + roll_l1_to_min_wg = lookupTableME21ILT_->GEM_roll_L1_CSC_min_wg_ME21_even(roll); + roll_l1_to_max_wg = lookupTableME21ILT_->GEM_roll_L1_CSC_max_wg_ME21_even(roll); } else { - roll_l1_to_min_wg = GEMCSCLUT_roll_l1_min_wg_ME21_odd_->lookup(roll); - roll_l1_to_max_wg = GEMCSCLUT_roll_l1_max_wg_ME21_odd_->lookup(roll); + roll_l1_to_min_wg = lookupTableME21ILT_->GEM_roll_L1_CSC_min_wg_ME21_odd(roll); + roll_l1_to_max_wg = lookupTableME21ILT_->GEM_roll_L1_CSC_max_wg_ME21_odd(roll); } } @@ -400,28 +354,28 @@ void GEMClusterProcessor::doCoordinateConversion() { if (station_ == 1) { if (isEven_) { // ME1/b - layer2_pad_to_first_hs = GEMCSCLUT_pad_hs_ME1b_even_->lookup(layer2_first_pad); - layer2_pad_to_last_hs = GEMCSCLUT_pad_hs_ME1b_even_->lookup(layer2_last_pad); + layer2_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer2_first_pad); + layer2_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer2_last_pad); // ME1/a - layer2_pad_to_first_hs_me1a = GEMCSCLUT_pad_hs_ME1a_even_->lookup(layer2_first_pad); - layer2_pad_to_last_hs_me1a = GEMCSCLUT_pad_hs_ME1a_even_->lookup(layer2_last_pad); + layer2_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer2_first_pad); + layer2_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer2_last_pad); } else { // ME1/b - layer2_pad_to_first_hs = GEMCSCLUT_pad_hs_ME1b_odd_->lookup(layer2_first_pad); - layer2_pad_to_last_hs = GEMCSCLUT_pad_hs_ME1b_odd_->lookup(layer2_last_pad); + layer2_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer2_first_pad); + layer2_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer2_last_pad); // ME1/a - layer2_pad_to_first_hs_me1a = GEMCSCLUT_pad_hs_ME1a_odd_->lookup(layer2_first_pad); - layer2_pad_to_last_hs_me1a = GEMCSCLUT_pad_hs_ME1a_odd_->lookup(layer2_last_pad); + layer2_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer2_first_pad); + layer2_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer2_last_pad); } } // ME2/1 if (station_ == 2) { if (isEven_) { - layer2_pad_to_first_hs = GEMCSCLUT_pad_hs_ME21_even_->lookup(layer2_first_pad); - layer2_pad_to_last_hs = GEMCSCLUT_pad_hs_ME21_even_->lookup(layer2_last_pad); + layer2_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer2_first_pad); + layer2_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer2_last_pad); } else { - layer2_pad_to_first_hs = GEMCSCLUT_pad_hs_ME21_odd_->lookup(layer2_first_pad); - layer2_pad_to_last_hs = GEMCSCLUT_pad_hs_ME21_odd_->lookup(layer2_last_pad); + layer2_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer2_first_pad); + layer2_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer2_last_pad); } } // middle 1/2-strip @@ -448,29 +402,29 @@ void GEMClusterProcessor::doCoordinateConversion() { if (station_ == 1) { if (isEven_) { // ME1/b - layer2_pad_to_first_es = GEMCSCLUT_pad_es_ME1b_even_->lookup(layer2_first_pad); - layer2_pad_to_last_es = GEMCSCLUT_pad_es_ME1b_even_->lookup(layer2_last_pad); + layer2_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer2_first_pad); + layer2_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer2_last_pad); // ME1/a - layer2_pad_to_first_es_me1a = GEMCSCLUT_pad_es_ME1a_even_->lookup(layer2_first_pad); - layer2_pad_to_last_es_me1a = GEMCSCLUT_pad_es_ME1a_even_->lookup(layer2_last_pad); + layer2_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer2_first_pad); + layer2_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer2_last_pad); } else { // ME1/b - layer2_pad_to_first_es = GEMCSCLUT_pad_es_ME1b_odd_->lookup(layer2_first_pad); - layer2_pad_to_last_es = GEMCSCLUT_pad_es_ME1b_odd_->lookup(layer2_last_pad); + layer2_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer2_first_pad); + layer2_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer2_last_pad); // ME1/a - layer2_pad_to_first_es_me1a = GEMCSCLUT_pad_es_ME1a_odd_->lookup(layer2_first_pad); - layer2_pad_to_last_es_me1a = GEMCSCLUT_pad_es_ME1a_odd_->lookup(layer2_last_pad); + layer2_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer2_first_pad); + layer2_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer2_last_pad); } } // ME2/1 if (station_ == 2) { if (isEven_) { - layer2_pad_to_first_es = GEMCSCLUT_pad_es_ME21_even_->lookup(layer2_first_pad); - layer2_pad_to_last_es = GEMCSCLUT_pad_es_ME21_even_->lookup(layer2_last_pad); + layer2_pad_to_first_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_even(layer2_first_pad); + layer2_pad_to_last_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_even(layer2_last_pad); } else { - layer2_pad_to_first_es = GEMCSCLUT_pad_es_ME21_odd_->lookup(layer2_first_pad); - layer2_pad_to_last_es = GEMCSCLUT_pad_es_ME21_odd_->lookup(layer2_last_pad); + layer2_pad_to_first_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_odd(layer2_first_pad); + layer2_pad_to_last_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_odd(layer2_last_pad); } } // middle 1/8-strip @@ -498,22 +452,22 @@ void GEMClusterProcessor::doCoordinateConversion() { // ME1/1 if (station_ == 1) { if (isEven_) { - roll_l2_to_min_wg = GEMCSCLUT_roll_l2_min_wg_ME11_even_->lookup(roll); - roll_l2_to_max_wg = GEMCSCLUT_roll_l2_max_wg_ME11_even_->lookup(roll); + roll_l2_to_min_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_min_wg_ME11_even(roll); + roll_l2_to_max_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_max_wg_ME11_even(roll); } else { - roll_l2_to_min_wg = GEMCSCLUT_roll_l2_min_wg_ME11_odd_->lookup(roll); - roll_l2_to_max_wg = GEMCSCLUT_roll_l2_max_wg_ME11_odd_->lookup(roll); + roll_l2_to_min_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_min_wg_ME11_odd(roll); + roll_l2_to_max_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_max_wg_ME11_odd(roll); } } // ME2/1 if (station_ == 2) { if (isEven_) { - roll_l2_to_min_wg = GEMCSCLUT_roll_l2_min_wg_ME21_even_->lookup(roll); - roll_l2_to_max_wg = GEMCSCLUT_roll_l2_max_wg_ME21_even_->lookup(roll); + roll_l2_to_min_wg = lookupTableME21ILT_->GEM_roll_L2_CSC_min_wg_ME21_even(roll); + roll_l2_to_max_wg = lookupTableME21ILT_->GEM_roll_L2_CSC_max_wg_ME21_even(roll); } else { - roll_l2_to_min_wg = GEMCSCLUT_roll_l2_min_wg_ME21_odd_->lookup(roll); - roll_l2_to_max_wg = GEMCSCLUT_roll_l2_max_wg_ME21_odd_->lookup(roll); + roll_l2_to_min_wg = lookupTableME21ILT_->GEM_roll_L2_CSC_min_wg_ME21_odd(roll); + roll_l2_to_max_wg = lookupTableME21ILT_->GEM_roll_L2_CSC_max_wg_ME21_odd(roll); } }