From 0acd2e188dda8acbd2196208abc92d2ea8d704c5 Mon Sep 17 00:00:00 2001 From: Norraphat Date: Mon, 21 Feb 2022 08:08:41 +0100 Subject: [PATCH 1/4] first try --- L1Trigger/TrackerDTC/interface/Setup.h | 6 ++- L1Trigger/TrackerDTC/plugins/ProducerES.cc | 54 +++++++++++++------ L1Trigger/TrackerDTC/python/ProducerES_cff.py | 11 +++- L1Trigger/TrackerDTC/python/ProducerES_cfi.py | 2 + L1Trigger/TrackerDTC/src/Setup.cc | 41 +++++++------- 5 files changed, 78 insertions(+), 36 deletions(-) diff --git a/L1Trigger/TrackerDTC/interface/Setup.h b/L1Trigger/TrackerDTC/interface/Setup.h index e9dadf7c9e20a..6200a0f511a80 100644 --- a/L1Trigger/TrackerDTC/interface/Setup.h +++ b/L1Trigger/TrackerDTC/interface/Setup.h @@ -14,6 +14,7 @@ #include "Geometry/CommonTopologies/interface/PixelGeomDetUnit.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "DetectorDescription/Core/interface/DDCompactView.h" +#include "DetectorDescription/DDCMS/interface/DDCompactView.h" #include "L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h" #include "MagneticField/Engine/interface/MagneticField.h" #include "CondFormats/SiPhase2TrackerObjects/interface/TrackerDetToDTCELinkCablingMap.h" @@ -453,6 +454,9 @@ namespace trackerDTC { // pset id of current geometry configuration edm::ParameterSetID pSetIdGeometryConfiguration_; + // DD4hep + bool fromDD4hep_; + // Parameter to check if configured Tracker Geometry is supported edm::ParameterSet pSetSG_; // label of ESProducer/ESSource @@ -936,4 +940,4 @@ namespace trackerDTC { EVENTSETUP_DATA_DEFAULT_RECORD(trackerDTC::Setup, trackerDTC::SetupRcd); -#endif \ No newline at end of file +#endif diff --git a/L1Trigger/TrackerDTC/plugins/ProducerES.cc b/L1Trigger/TrackerDTC/plugins/ProducerES.cc index f4372e67191ea..6f60c79ccf299 100644 --- a/L1Trigger/TrackerDTC/plugins/ProducerES.cc +++ b/L1Trigger/TrackerDTC/plugins/ProducerES.cc @@ -34,16 +34,22 @@ namespace trackerDTC { ESGetToken getTokenTrackerTopology_; ESGetToken getTokenCablingMap_; ESGetToken getTokenGeometryConfiguration_; + ESGetToken getTokenGeometryConfigurationDD4hep_; + bool fromDD4hep_; }; ProducerES::ProducerES(const ParameterSet& iConfig) : iConfig_(iConfig) { + fromDD4hep_ = iConfig.getParameter("fromDD4hep"); auto cc = setWhatProduced(this); getTokenTTStubAlgorithm_ = cc.consumes(); getTokenMagneticField_ = cc.consumes(); getTokenTrackerGeometry_ = cc.consumes(); getTokenTrackerTopology_ = cc.consumes(); getTokenCablingMap_ = cc.consumes(); - getTokenGeometryConfiguration_ = cc.consumes(); + if (fromDD4hep_) + getTokenGeometryConfigurationDD4hep_ = cc.consumes(); + else + getTokenGeometryConfiguration_ = cc.consumes(); } unique_ptr ProducerES::produce(const SetupRcd& setupRcd) { @@ -52,25 +58,41 @@ namespace trackerDTC { const TrackerTopology& trackerTopology = setupRcd.get(getTokenTrackerTopology_); const TrackerDetToDTCELinkCablingMap& cablingMap = setupRcd.get(getTokenCablingMap_); const ESHandle handleStubAlgorithm = setupRcd.getHandle(getTokenTTStubAlgorithm_); - const ESHandle handleGeometryConfiguration = setupRcd.getHandle(getTokenGeometryConfiguration_); const ParameterSetID& pSetIdTTStubAlgorithm = handleStubAlgorithm.description()->pid_; - const ParameterSetID& pSetIdGeometryConfiguration = handleGeometryConfiguration.description()->pid_; const StubAlgorithmOfficial& stubAlgoritm = - *dynamic_cast(&setupRcd.get(getTokenTTStubAlgorithm_)); + *dynamic_cast(&setupRcd.get(getTokenTTStubAlgorithm_)); const ParameterSet& pSetStubAlgorithm = getParameterSet(handleStubAlgorithm.description()->pid_); - const ParameterSet& pSetGeometryConfiguration = getParameterSet(handleGeometryConfiguration.description()->pid_); - return make_unique(iConfig_, - magneticField, - trackerGeometry, - trackerTopology, - cablingMap, - stubAlgoritm, - pSetStubAlgorithm, - pSetGeometryConfiguration, - pSetIdTTStubAlgorithm, - pSetIdGeometryConfiguration); + if (fromDD4hep_){ + const ESHandle handleGeometryConfiguration = setupRcd.getHandle(getTokenGeometryConfigurationDD4hep_); + const ParameterSetID& pSetIdGeometryConfiguration = handleGeometryConfiguration.description()->pid_; + const ParameterSet& pSetGeometryConfiguration = getParameterSet(handleGeometryConfiguration.description()->pid_); + return make_unique(iConfig_, + magneticField, + trackerGeometry, + trackerTopology, + cablingMap, + stubAlgoritm, + pSetStubAlgorithm, + pSetGeometryConfiguration, + pSetIdTTStubAlgorithm, + pSetIdGeometryConfiguration); + } + else{ + const ESHandle handleGeometryConfiguration = setupRcd.getHandle(getTokenGeometryConfiguration_); + const ParameterSetID& pSetIdGeometryConfiguration = handleGeometryConfiguration.description()->pid_; + const ParameterSet& pSetGeometryConfiguration = getParameterSet(handleGeometryConfiguration.description()->pid_); + return make_unique(iConfig_, + magneticField, + trackerGeometry, + trackerTopology, + cablingMap, + stubAlgoritm, + pSetStubAlgorithm, + pSetGeometryConfiguration, + pSetIdTTStubAlgorithm, + pSetIdGeometryConfiguration); + } } - } // namespace trackerDTC DEFINE_FWK_EVENTSETUP_MODULE(trackerDTC::ProducerES); diff --git a/L1Trigger/TrackerDTC/python/ProducerES_cff.py b/L1Trigger/TrackerDTC/python/ProducerES_cff.py index 227b78564e62e..e62787308b0be 100644 --- a/L1Trigger/TrackerDTC/python/ProducerES_cff.py +++ b/L1Trigger/TrackerDTC/python/ProducerES_cff.py @@ -2,4 +2,13 @@ from L1Trigger.TrackerDTC.ProducerES_cfi import TrackTrigger_params -TrackTriggerSetup = cms.ESProducer("trackerDTC::ProducerES", TrackTrigger_params) \ No newline at end of file +from Configuration.ProcessModifiers.dd4hep_cff import dd4hep +dd4hep.toModify(TrackTrigger_params, + fromDD4hep = cms.bool(True), + ProcessHistory = cms.PSet ( + GeometryConfiguration = cms.string("DDDetectorESProducer@"), + TTStubAlgorithm = cms.string("TTStubAlgorithm_official_Phase2TrackerDigi_@") + ) +) + +TrackTriggerSetup = cms.ESProducer("trackerDTC::ProducerES", TrackTrigger_params) diff --git a/L1Trigger/TrackerDTC/python/ProducerES_cfi.py b/L1Trigger/TrackerDTC/python/ProducerES_cfi.py index 49fc6367ba94a..24c327f5ee855 100644 --- a/L1Trigger/TrackerDTC/python/ProducerES_cfi.py +++ b/L1Trigger/TrackerDTC/python/ProducerES_cfi.py @@ -1,6 +1,8 @@ import FWCore.ParameterSet.Config as cms TrackTrigger_params = cms.PSet ( + # + fromDD4hep = cms.bool(False), # Parameter to check if configured Tracker Geometry is supported SupportedGeometry = cms.PSet ( diff --git a/L1Trigger/TrackerDTC/src/Setup.cc b/L1Trigger/TrackerDTC/src/Setup.cc index 87febae598830..047ad39820ca5 100644 --- a/L1Trigger/TrackerDTC/src/Setup.cc +++ b/L1Trigger/TrackerDTC/src/Setup.cc @@ -35,6 +35,8 @@ namespace trackerDTC { pSetGC_(&pSetGeometryConfiguration), pSetIdTTStubAlgorithm_(pSetIdTTStubAlgorithm), pSetIdGeometryConfiguration_(pSetIdGeometryConfiguration), + // DD4hep + fromDD4hep_(iConfig.getParameter("fromDD4hep")), // Parameter to check if configured Tracker Geometry is supported pSetSG_(iConfig.getParameter("SupportedGeometry")), sgXMLLabel_(pSetSG_.getParameter("XMLLabel")), @@ -354,24 +356,27 @@ namespace trackerDTC { // check if geometry is supported void Setup::checkGeometry() { - const vector& geomXMLFiles = pSetGC_->getParameter>(sgXMLLabel_); - string version; - for (const string& geomXMLFile : geomXMLFiles) { - const auto begin = geomXMLFile.find(sgXMLPath_) + sgXMLPath_.size(); - const auto end = geomXMLFile.find(sgXMLFile_); - if (begin != string::npos && end != string::npos) - version = geomXMLFile.substr(begin, end - begin - 1); - } - if (version.empty()) { - cms::Exception exception("LogicError"); - exception << "No " << sgXMLPath_ << "*/" << sgXMLFile_ << " found in GeometryConfiguration"; - exception.addContext("tt::Setup::checkGeometry"); - throw exception; - } - if (find(sgXMLVersions_.begin(), sgXMLVersions_.end(), version) == sgXMLVersions_.end()) { - configurationSupported_ = false; - LogWarning("ConfigurationNotSupported") + //FIX ME: Can we assume that geometry used in dd4hep wf supports L1Track? + if(!fromDD4hep_){ + const vector& geomXMLFiles = pSetGC_->getParameter>(sgXMLLabel_); + string version; + for (const string& geomXMLFile : geomXMLFiles) { + const auto begin = geomXMLFile.find(sgXMLPath_) + sgXMLPath_.size(); + const auto end = geomXMLFile.find(sgXMLFile_); + if (begin != string::npos && end != string::npos) + version = geomXMLFile.substr(begin, end - begin - 1); + } + if (version.empty()) { + cms::Exception exception("LogicError"); + exception << "No " << sgXMLPath_ << "*/" << sgXMLFile_ << " found in GeometryConfiguration"; + exception.addContext("tt::Setup::checkGeometry"); + throw exception; + } + if (find(sgXMLVersions_.begin(), sgXMLVersions_.end(), version) == sgXMLVersions_.end()) { + configurationSupported_ = false; + LogWarning("ConfigurationNotSupported") << "Geometry Configuration " << sgXMLPath_ << version << "/" << sgXMLFile_ << " is not supported. "; + } } } @@ -727,4 +732,4 @@ namespace trackerDTC { } } -} // namespace trackerDTC \ No newline at end of file +} // namespace trackerDTC From b929da7e53016f47c94b54412ab9a5bef5f52771 Mon Sep 17 00:00:00 2001 From: Norraphat Date: Mon, 21 Feb 2022 08:40:02 +0100 Subject: [PATCH 2/4] code format --- L1Trigger/TrackerDTC/plugins/ProducerES.cc | 6 +++--- L1Trigger/TrackerDTC/python/ProducerES_cfi.py | 4 ++-- L1Trigger/TrackerDTC/src/Setup.cc | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/L1Trigger/TrackerDTC/plugins/ProducerES.cc b/L1Trigger/TrackerDTC/plugins/ProducerES.cc index 6f60c79ccf299..fa130049aa9e0 100644 --- a/L1Trigger/TrackerDTC/plugins/ProducerES.cc +++ b/L1Trigger/TrackerDTC/plugins/ProducerES.cc @@ -25,7 +25,7 @@ namespace trackerDTC { ProducerES(const ParameterSet& iConfig); ~ProducerES() override {} unique_ptr produce(const SetupRcd& setupRcd); - + private: const ParameterSet iConfig_; ESGetToken getTokenTTStubAlgorithm_; @@ -37,7 +37,7 @@ namespace trackerDTC { ESGetToken getTokenGeometryConfigurationDD4hep_; bool fromDD4hep_; }; - + ProducerES::ProducerES(const ParameterSet& iConfig) : iConfig_(iConfig) { fromDD4hep_ = iConfig.getParameter("fromDD4hep"); auto cc = setWhatProduced(this); @@ -51,7 +51,7 @@ namespace trackerDTC { else getTokenGeometryConfiguration_ = cc.consumes(); } - + unique_ptr ProducerES::produce(const SetupRcd& setupRcd) { const MagneticField& magneticField = setupRcd.get(getTokenMagneticField_); const TrackerGeometry& trackerGeometry = setupRcd.get(getTokenTrackerGeometry_); diff --git a/L1Trigger/TrackerDTC/python/ProducerES_cfi.py b/L1Trigger/TrackerDTC/python/ProducerES_cfi.py index 24c327f5ee855..dc3423e045c41 100644 --- a/L1Trigger/TrackerDTC/python/ProducerES_cfi.py +++ b/L1Trigger/TrackerDTC/python/ProducerES_cfi.py @@ -1,8 +1,8 @@ import FWCore.ParameterSet.Config as cms TrackTrigger_params = cms.PSet ( - # - fromDD4hep = cms.bool(False), + + fromDD4hep = cms.bool(True), # Parameter to check if configured Tracker Geometry is supported SupportedGeometry = cms.PSet ( diff --git a/L1Trigger/TrackerDTC/src/Setup.cc b/L1Trigger/TrackerDTC/src/Setup.cc index 047ad39820ca5..f2e36ddd498b9 100644 --- a/L1Trigger/TrackerDTC/src/Setup.cc +++ b/L1Trigger/TrackerDTC/src/Setup.cc @@ -357,7 +357,7 @@ namespace trackerDTC { // check if geometry is supported void Setup::checkGeometry() { //FIX ME: Can we assume that geometry used in dd4hep wf supports L1Track? - if(!fromDD4hep_){ + if (!fromDD4hep_){ const vector& geomXMLFiles = pSetGC_->getParameter>(sgXMLLabel_); string version; for (const string& geomXMLFile : geomXMLFiles) { @@ -379,7 +379,7 @@ namespace trackerDTC { } } } - + // convert configuration of TTStubAlgorithm void Setup::consumeStubAlgorithm() { numTiltedLayerRings_ = pSetSA_->getParameter>("NTiltedRings"); From d4b2d4f575161a0e42482bf808b9e9223ba252f1 Mon Sep 17 00:00:00 2001 From: Norraphat Date: Mon, 21 Feb 2022 16:17:49 +0100 Subject: [PATCH 3/4] fix format --- L1Trigger/TrackerDTC/plugins/ProducerES.cc | 5 +- L1Trigger/TrackerDTC/python/ProducerES_cfi.py | 2 +- L1Trigger/TrackerDTC/src/Setup.cc | 404 +++++++++--------- 3 files changed, 205 insertions(+), 206 deletions(-) diff --git a/L1Trigger/TrackerDTC/plugins/ProducerES.cc b/L1Trigger/TrackerDTC/plugins/ProducerES.cc index fa130049aa9e0..8e66512aacebf 100644 --- a/L1Trigger/TrackerDTC/plugins/ProducerES.cc +++ b/L1Trigger/TrackerDTC/plugins/ProducerES.cc @@ -14,7 +14,7 @@ using namespace std; using namespace edm; namespace trackerDTC { - + /*! \class trackerDTC::ProducerES * \brief Class to produce setup of Track Trigger emulators * \author Thomas Schuh @@ -59,8 +59,7 @@ namespace trackerDTC { const TrackerDetToDTCELinkCablingMap& cablingMap = setupRcd.get(getTokenCablingMap_); const ESHandle handleStubAlgorithm = setupRcd.getHandle(getTokenTTStubAlgorithm_); const ParameterSetID& pSetIdTTStubAlgorithm = handleStubAlgorithm.description()->pid_; - const StubAlgorithmOfficial& stubAlgoritm = - *dynamic_cast(&setupRcd.get(getTokenTTStubAlgorithm_)); + const StubAlgorithmOfficial& stubAlgoritm = *dynamic_cast(&setupRcd.get(getTokenTTStubAlgorithm_)); const ParameterSet& pSetStubAlgorithm = getParameterSet(handleStubAlgorithm.description()->pid_); if (fromDD4hep_){ const ESHandle handleGeometryConfiguration = setupRcd.getHandle(getTokenGeometryConfigurationDD4hep_); diff --git a/L1Trigger/TrackerDTC/python/ProducerES_cfi.py b/L1Trigger/TrackerDTC/python/ProducerES_cfi.py index dc3423e045c41..dae8d2f1a0133 100644 --- a/L1Trigger/TrackerDTC/python/ProducerES_cfi.py +++ b/L1Trigger/TrackerDTC/python/ProducerES_cfi.py @@ -2,7 +2,7 @@ TrackTrigger_params = cms.PSet ( - fromDD4hep = cms.bool(True), + fromDD4hep = cms.bool(False), # Parameter to check if configured Tracker Geometry is supported SupportedGeometry = cms.PSet ( diff --git a/L1Trigger/TrackerDTC/src/Setup.cc b/L1Trigger/TrackerDTC/src/Setup.cc index f2e36ddd498b9..11e3ce977dffc 100644 --- a/L1Trigger/TrackerDTC/src/Setup.cc +++ b/L1Trigger/TrackerDTC/src/Setup.cc @@ -15,7 +15,7 @@ using namespace std; using namespace edm; namespace trackerDTC { - + Setup::Setup(const ParameterSet& iConfig, const MagneticField& magneticField, const TrackerGeometry& trackerGeometry, @@ -26,175 +26,175 @@ namespace trackerDTC { const ParameterSet& pSetGeometryConfiguration, const ParameterSetID& pSetIdTTStubAlgorithm, const ParameterSetID& pSetIdGeometryConfiguration) - : magneticField_(&magneticField), - trackerGeometry_(&trackerGeometry), - trackerTopology_(&trackerTopology), - cablingMap_(&cablingMap), - stubAlgorithm_(&stubAlgorithm), - pSetSA_(&pSetStubAlgorithm), - pSetGC_(&pSetGeometryConfiguration), - pSetIdTTStubAlgorithm_(pSetIdTTStubAlgorithm), - pSetIdGeometryConfiguration_(pSetIdGeometryConfiguration), - // DD4hep - fromDD4hep_(iConfig.getParameter("fromDD4hep")), - // Parameter to check if configured Tracker Geometry is supported - pSetSG_(iConfig.getParameter("SupportedGeometry")), - sgXMLLabel_(pSetSG_.getParameter("XMLLabel")), - sgXMLPath_(pSetSG_.getParameter("XMLPath")), - sgXMLFile_(pSetSG_.getParameter("XMLFile")), - sgXMLVersions_(pSetSG_.getParameter>("XMLVersions")), - // Parameter to check if Process History is consistent with process configuration - pSetPH_(iConfig.getParameter("ProcessHistory")), - phGeometryConfiguration_(pSetPH_.getParameter("GeometryConfiguration")), - phTTStubAlgorithm_(pSetPH_.getParameter("TTStubAlgorithm")), - // Common track finding parameter - pSetTF_(iConfig.getParameter("TrackFinding")), - beamWindowZ_(pSetTF_.getParameter("BeamWindowZ")), - matchedLayers_(pSetTF_.getParameter("MatchedLayers")), - matchedLayersPS_(pSetTF_.getParameter("MatchedLayersPS")), - unMatchedStubs_(pSetTF_.getParameter("UnMatchedStubs")), - unMatchedStubsPS_(pSetTF_.getParameter("UnMatchedStubsPS")), - // TMTT specific parameter - pSetTMTT_(iConfig.getParameter("TMTT")), - minPt_(pSetTMTT_.getParameter("MinPt")), - maxEta_(pSetTMTT_.getParameter("MaxEta")), - chosenRofPhi_(pSetTMTT_.getParameter("ChosenRofPhi")), - numLayers_(pSetTMTT_.getParameter("NumLayers")), - widthR_(pSetTMTT_.getParameter("WidthR")), - widthPhi_(pSetTMTT_.getParameter("WidthPhi")), - widthZ_(pSetTMTT_.getParameter("WidthZ")), - // Hybrid specific parameter - pSetHybrid_(iConfig.getParameter("Hybrid")), - hybridMinPt_(pSetHybrid_.getParameter("MinPt")), - hybridMaxEta_(pSetHybrid_.getParameter("MaxEta")), - hybridChosenRofPhi_(pSetHybrid_.getParameter("ChosenRofPhi")), - hybridNumLayers_(pSetHybrid_.getParameter("NumLayers")), - hybridNumRingsPS_(pSetHybrid_.getParameter>("NumRingsPS")), - hybridWidthsR_(pSetHybrid_.getParameter>("WidthsR")), - hybridWidthsZ_(pSetHybrid_.getParameter>("WidthsZ")), - hybridWidthsPhi_(pSetHybrid_.getParameter>("WidthsPhi")), - hybridWidthsAlpha_(pSetHybrid_.getParameter>("WidthsAlpha")), - hybridWidthsBend_(pSetHybrid_.getParameter>("WidthsBend")), - hybridRangesR_(pSetHybrid_.getParameter>("RangesR")), - hybridRangesZ_(pSetHybrid_.getParameter>("RangesZ")), - hybridRangesAlpha_(pSetHybrid_.getParameter>("RangesAlpha")), - hybridLayerRs_(pSetHybrid_.getParameter>("LayerRs")), - hybridDiskZs_(pSetHybrid_.getParameter>("DiskZs")), - hybridDisk2SRsSet_(pSetHybrid_.getParameter>("Disk2SRsSet")), - // Parameter specifying TrackingParticle used for Efficiency measurements - pSetTP_(iConfig.getParameter("TrackingParticle")), - tpMaxEta_(pSetTP_.getParameter("MaxEta")), - tpMaxVertR_(pSetTP_.getParameter("MaxVertR")), - tpMaxVertZ_(pSetTP_.getParameter("MaxVertZ")), - tpMaxD0_(pSetTP_.getParameter("MaxD0")), - tpMinLayers_(pSetTP_.getParameter("MinLayers")), - tpMinLayersPS_(pSetTP_.getParameter("MinLayersPS")), - // Fimrware specific Parameter - pSetFW_(iConfig.getParameter("Firmware")), - numFramesInfra_(pSetFW_.getParameter("NumFramesInfra")), - freqLHC_(pSetFW_.getParameter("FreqLHC")), - freqBE_(pSetFW_.getParameter("FreqBE")), - tmpFE_(pSetFW_.getParameter("TMP_FE")), - tmpTFP_(pSetFW_.getParameter("TMP_TFP")), - speedOfLight_(pSetFW_.getParameter("SpeedOfLight")), - bField_(pSetFW_.getParameter("BField")), - bFieldError_(pSetFW_.getParameter("BFieldError")), - outerRadius_(pSetFW_.getParameter("OuterRadius")), - innerRadius_(pSetFW_.getParameter("InnerRadius")), - halfLength_(pSetFW_.getParameter("HalfLength")), - maxPitch_(pSetFW_.getParameter("MaxPitch")), - // Parmeter specifying front-end - pSetFE_(iConfig.getParameter("FrontEnd")), - widthBend_(pSetFE_.getParameter("WidthBend")), - widthCol_(pSetFE_.getParameter("WidthCol")), - widthRow_(pSetFE_.getParameter("WidthRow")), - baseBend_(pSetFE_.getParameter("BaseBend")), - baseCol_(pSetFE_.getParameter("BaseCol")), - baseRow_(pSetFE_.getParameter("BaseRow")), - baseWindowSize_(pSetFE_.getParameter("BaseWindowSize")), - bendCut_(pSetFE_.getParameter("BendCut")), - // Parmeter specifying DTC - pSetDTC_(iConfig.getParameter("DTC")), - numRegions_(pSetDTC_.getParameter("NumRegions")), - numOverlappingRegions_(pSetDTC_.getParameter("NumOverlappingRegions")), - numATCASlots_(pSetDTC_.getParameter("NumATCASlots")), - numDTCsPerRegion_(pSetDTC_.getParameter("NumDTCsPerRegion")), - numModulesPerDTC_(pSetDTC_.getParameter("NumModulesPerDTC")), - dtcNumRoutingBlocks_(pSetDTC_.getParameter("NumRoutingBlocks")), - dtcDepthMemory_(pSetDTC_.getParameter("DepthMemory")), - dtcWidthRowLUT_(pSetDTC_.getParameter("WidthRowLUT")), - dtcWidthQoverPt_(pSetDTC_.getParameter("WidthQoverPt")), - offsetDetIdDSV_(pSetDTC_.getParameter("OffsetDetIdDSV")), - offsetDetIdTP_(pSetDTC_.getParameter("OffsetDetIdTP")), - offsetLayerDisks_(pSetDTC_.getParameter("OffsetLayerDisks")), - offsetLayerId_(pSetDTC_.getParameter("OffsetLayerId")), - // Parmeter specifying GeometricProcessor - pSetGP_(iConfig.getParameter("GeometricProcessor")), - numSectorsPhi_(pSetGP_.getParameter("NumSectorsPhi")), - chosenRofZ_(pSetGP_.getParameter("ChosenRofZ")), - neededRangeChiZ_(pSetGP_.getParameter("RangeChiZ")), - gpDepthMemory_(pSetGP_.getParameter("DepthMemory")), - boundariesEta_(pSetGP_.getParameter>("BoundariesEta")), - // Parmeter specifying HoughTransform - pSetHT_(iConfig.getParameter("HoughTransform")), - htNumBinsQoverPt_(pSetHT_.getParameter("NumBinsQoverPt")), - htNumBinsPhiT_(pSetHT_.getParameter("NumBinsPhiT")), - htMinLayers_(pSetHT_.getParameter("MinLayers")), - htDepthMemory_(pSetHT_.getParameter("DepthMemory")), - // Parmeter specifying MiniHoughTransform - pSetMHT_(iConfig.getParameter("MiniHoughTransform")), - mhtNumBinsQoverPt_(pSetMHT_.getParameter("NumBinsQoverPt")), - mhtNumBinsPhiT_(pSetMHT_.getParameter("NumBinsPhiT")), - mhtNumDLB_(pSetMHT_.getParameter("NumDLB")), - mhtMinLayers_(pSetMHT_.getParameter("MinLayers")), - // Parmeter specifying SeedFilter - pSetSF_(iConfig.getParameter("SeedFilter")), - sfPowerBaseCot_(pSetSF_.getParameter("PowerBaseCot")), - sfBaseDiffZ_(pSetSF_.getParameter("BaseDiffZ")), - sfMinLayers_(pSetSF_.getParameter("MinLayers")), - // Parmeter specifying KalmanFilter - pSetKF_(iConfig.getParameter("KalmanFilter")), - kfWidthLutInvPhi_(pSetKF_.getParameter("WidthLutInvPhi")), - kfWidthLutInvZ_(pSetKF_.getParameter("WidthLutInvZ")), - kfNumTracks_(pSetKF_.getParameter("NumTracks")), - kfMinLayers_(pSetKF_.getParameter("MinLayers")), - kfMaxLayers_(pSetKF_.getParameter("MaxLayers")), - kfMaxStubsPerLayer_(pSetKF_.getParameter("MaxStubsPerLayer")), - kfMaxSkippedLayers_(pSetKF_.getParameter("MaxSkippedLayers")), - kfBaseShiftr0_(pSetKF_.getParameter("BaseShiftr0")), - kfBaseShiftr02_(pSetKF_.getParameter("BaseShiftr02")), - kfBaseShiftv0_(pSetKF_.getParameter("BaseShiftv0")), - kfBaseShiftS00_(pSetKF_.getParameter("BaseShiftS00")), - kfBaseShiftS01_(pSetKF_.getParameter("BaseShiftS01")), - kfBaseShiftK00_(pSetKF_.getParameter("BaseShiftK00")), - kfBaseShiftK10_(pSetKF_.getParameter("BaseShiftK10")), - kfBaseShiftR00_(pSetKF_.getParameter("BaseShiftR00")), - kfBaseShiftInvR00_(pSetKF_.getParameter("BaseShiftInvR00")), - kfBaseShiftChi20_(pSetKF_.getParameter("BaseShiftChi20")), - kfBaseShiftC00_(pSetKF_.getParameter("BaseShiftC00")), - kfBaseShiftC01_(pSetKF_.getParameter("BaseShiftC01")), - kfBaseShiftC11_(pSetKF_.getParameter("BaseShiftC11")), - kfBaseShiftr1_(pSetKF_.getParameter("BaseShiftr1")), - kfBaseShiftr12_(pSetKF_.getParameter("BaseShiftr12")), - kfBaseShiftv1_(pSetKF_.getParameter("BaseShiftv1")), - kfBaseShiftS12_(pSetKF_.getParameter("BaseShiftS12")), - kfBaseShiftS13_(pSetKF_.getParameter("BaseShiftS13")), - kfBaseShiftK21_(pSetKF_.getParameter("BaseShiftK21")), - kfBaseShiftK31_(pSetKF_.getParameter("BaseShiftK31")), - kfBaseShiftR11_(pSetKF_.getParameter("BaseShiftR11")), - kfBaseShiftInvR11_(pSetKF_.getParameter("BaseShiftInvR11")), - kfBaseShiftChi21_(pSetKF_.getParameter("BaseShiftChi21")), - kfBaseShiftC22_(pSetKF_.getParameter("BaseShiftC22")), - kfBaseShiftC23_(pSetKF_.getParameter("BaseShiftC23")), - kfBaseShiftC33_(pSetKF_.getParameter("BaseShiftC33")), - kfBaseShiftChi2_(pSetKF_.getParameter("BaseShiftChi2")), - // Parmeter specifying DuplicateRemoval - pSetDR_(iConfig.getParameter("DuplicateRemoval")), - drDepthMemory_(pSetDR_.getParameter("DepthMemory")), - drWidthPhi0_(pSetDR_.getParameter("WidthPhi0")), - drWidthQoverPt_(pSetDR_.getParameter("WidthQoverPt")), - drWidthCot_(pSetDR_.getParameter("WidthCot")), - drWidthZ0_(pSetDR_.getParameter("WidthZ0")) { + : magneticField_(&magneticField), + trackerGeometry_(&trackerGeometry), + trackerTopology_(&trackerTopology), + cablingMap_(&cablingMap), + stubAlgorithm_(&stubAlgorithm), + pSetSA_(&pSetStubAlgorithm), + pSetGC_(&pSetGeometryConfiguration), + pSetIdTTStubAlgorithm_(pSetIdTTStubAlgorithm), + pSetIdGeometryConfiguration_(pSetIdGeometryConfiguration), + // DD4hep + fromDD4hep_(iConfig.getParameter("fromDD4hep")), + // Parameter to check if configured Tracker Geometry is supported + pSetSG_(iConfig.getParameter("SupportedGeometry")), + sgXMLLabel_(pSetSG_.getParameter("XMLLabel")), + sgXMLPath_(pSetSG_.getParameter("XMLPath")), + sgXMLFile_(pSetSG_.getParameter("XMLFile")), + sgXMLVersions_(pSetSG_.getParameter>("XMLVersions")), + // Parameter to check if Process History is consistent with process configuration + pSetPH_(iConfig.getParameter("ProcessHistory")), + phGeometryConfiguration_(pSetPH_.getParameter("GeometryConfiguration")), + phTTStubAlgorithm_(pSetPH_.getParameter("TTStubAlgorithm")), + // Common track finding parameter + pSetTF_(iConfig.getParameter("TrackFinding")), + beamWindowZ_(pSetTF_.getParameter("BeamWindowZ")), + matchedLayers_(pSetTF_.getParameter("MatchedLayers")), + matchedLayersPS_(pSetTF_.getParameter("MatchedLayersPS")), + unMatchedStubs_(pSetTF_.getParameter("UnMatchedStubs")), + unMatchedStubsPS_(pSetTF_.getParameter("UnMatchedStubsPS")), + // TMTT specific parameter + pSetTMTT_(iConfig.getParameter("TMTT")), + minPt_(pSetTMTT_.getParameter("MinPt")), + maxEta_(pSetTMTT_.getParameter("MaxEta")), + chosenRofPhi_(pSetTMTT_.getParameter("ChosenRofPhi")), + numLayers_(pSetTMTT_.getParameter("NumLayers")), + widthR_(pSetTMTT_.getParameter("WidthR")), + widthPhi_(pSetTMTT_.getParameter("WidthPhi")), + widthZ_(pSetTMTT_.getParameter("WidthZ")), + // Hybrid specific parameter + pSetHybrid_(iConfig.getParameter("Hybrid")), + hybridMinPt_(pSetHybrid_.getParameter("MinPt")), + hybridMaxEta_(pSetHybrid_.getParameter("MaxEta")), + hybridChosenRofPhi_(pSetHybrid_.getParameter("ChosenRofPhi")), + hybridNumLayers_(pSetHybrid_.getParameter("NumLayers")), + hybridNumRingsPS_(pSetHybrid_.getParameter>("NumRingsPS")), + hybridWidthsR_(pSetHybrid_.getParameter>("WidthsR")), + hybridWidthsZ_(pSetHybrid_.getParameter>("WidthsZ")), + hybridWidthsPhi_(pSetHybrid_.getParameter>("WidthsPhi")), + hybridWidthsAlpha_(pSetHybrid_.getParameter>("WidthsAlpha")), + hybridWidthsBend_(pSetHybrid_.getParameter>("WidthsBend")), + hybridRangesR_(pSetHybrid_.getParameter>("RangesR")), + hybridRangesZ_(pSetHybrid_.getParameter>("RangesZ")), + hybridRangesAlpha_(pSetHybrid_.getParameter>("RangesAlpha")), + hybridLayerRs_(pSetHybrid_.getParameter>("LayerRs")), + hybridDiskZs_(pSetHybrid_.getParameter>("DiskZs")), + hybridDisk2SRsSet_(pSetHybrid_.getParameter>("Disk2SRsSet")), + // Parameter specifying TrackingParticle used for Efficiency measurements + pSetTP_(iConfig.getParameter("TrackingParticle")), + tpMaxEta_(pSetTP_.getParameter("MaxEta")), + tpMaxVertR_(pSetTP_.getParameter("MaxVertR")), + tpMaxVertZ_(pSetTP_.getParameter("MaxVertZ")), + tpMaxD0_(pSetTP_.getParameter("MaxD0")), + tpMinLayers_(pSetTP_.getParameter("MinLayers")), + tpMinLayersPS_(pSetTP_.getParameter("MinLayersPS")), + // Fimrware specific Parameter + pSetFW_(iConfig.getParameter("Firmware")), + numFramesInfra_(pSetFW_.getParameter("NumFramesInfra")), + freqLHC_(pSetFW_.getParameter("FreqLHC")), + freqBE_(pSetFW_.getParameter("FreqBE")), + tmpFE_(pSetFW_.getParameter("TMP_FE")), + tmpTFP_(pSetFW_.getParameter("TMP_TFP")), + speedOfLight_(pSetFW_.getParameter("SpeedOfLight")), + bField_(pSetFW_.getParameter("BField")), + bFieldError_(pSetFW_.getParameter("BFieldError")), + outerRadius_(pSetFW_.getParameter("OuterRadius")), + innerRadius_(pSetFW_.getParameter("InnerRadius")), + halfLength_(pSetFW_.getParameter("HalfLength")), + maxPitch_(pSetFW_.getParameter("MaxPitch")), + // Parmeter specifying front-end + pSetFE_(iConfig.getParameter("FrontEnd")), + widthBend_(pSetFE_.getParameter("WidthBend")), + widthCol_(pSetFE_.getParameter("WidthCol")), + widthRow_(pSetFE_.getParameter("WidthRow")), + baseBend_(pSetFE_.getParameter("BaseBend")), + baseCol_(pSetFE_.getParameter("BaseCol")), + baseRow_(pSetFE_.getParameter("BaseRow")), + baseWindowSize_(pSetFE_.getParameter("BaseWindowSize")), + bendCut_(pSetFE_.getParameter("BendCut")), + // Parmeter specifying DTC + pSetDTC_(iConfig.getParameter("DTC")), + numRegions_(pSetDTC_.getParameter("NumRegions")), + numOverlappingRegions_(pSetDTC_.getParameter("NumOverlappingRegions")), + numATCASlots_(pSetDTC_.getParameter("NumATCASlots")), + numDTCsPerRegion_(pSetDTC_.getParameter("NumDTCsPerRegion")), + numModulesPerDTC_(pSetDTC_.getParameter("NumModulesPerDTC")), + dtcNumRoutingBlocks_(pSetDTC_.getParameter("NumRoutingBlocks")), + dtcDepthMemory_(pSetDTC_.getParameter("DepthMemory")), + dtcWidthRowLUT_(pSetDTC_.getParameter("WidthRowLUT")), + dtcWidthQoverPt_(pSetDTC_.getParameter("WidthQoverPt")), + offsetDetIdDSV_(pSetDTC_.getParameter("OffsetDetIdDSV")), + offsetDetIdTP_(pSetDTC_.getParameter("OffsetDetIdTP")), + offsetLayerDisks_(pSetDTC_.getParameter("OffsetLayerDisks")), + offsetLayerId_(pSetDTC_.getParameter("OffsetLayerId")), + // Parmeter specifying GeometricProcessor + pSetGP_(iConfig.getParameter("GeometricProcessor")), + numSectorsPhi_(pSetGP_.getParameter("NumSectorsPhi")), + chosenRofZ_(pSetGP_.getParameter("ChosenRofZ")), + neededRangeChiZ_(pSetGP_.getParameter("RangeChiZ")), + gpDepthMemory_(pSetGP_.getParameter("DepthMemory")), + boundariesEta_(pSetGP_.getParameter>("BoundariesEta")), + // Parmeter specifying HoughTransform + pSetHT_(iConfig.getParameter("HoughTransform")), + htNumBinsQoverPt_(pSetHT_.getParameter("NumBinsQoverPt")), + htNumBinsPhiT_(pSetHT_.getParameter("NumBinsPhiT")), + htMinLayers_(pSetHT_.getParameter("MinLayers")), + htDepthMemory_(pSetHT_.getParameter("DepthMemory")), + // Parmeter specifying MiniHoughTransform + pSetMHT_(iConfig.getParameter("MiniHoughTransform")), + mhtNumBinsQoverPt_(pSetMHT_.getParameter("NumBinsQoverPt")), + mhtNumBinsPhiT_(pSetMHT_.getParameter("NumBinsPhiT")), + mhtNumDLB_(pSetMHT_.getParameter("NumDLB")), + mhtMinLayers_(pSetMHT_.getParameter("MinLayers")), + // Parmeter specifying SeedFilter + pSetSF_(iConfig.getParameter("SeedFilter")), + sfPowerBaseCot_(pSetSF_.getParameter("PowerBaseCot")), + sfBaseDiffZ_(pSetSF_.getParameter("BaseDiffZ")), + sfMinLayers_(pSetSF_.getParameter("MinLayers")), + // Parmeter specifying KalmanFilter + pSetKF_(iConfig.getParameter("KalmanFilter")), + kfWidthLutInvPhi_(pSetKF_.getParameter("WidthLutInvPhi")), + kfWidthLutInvZ_(pSetKF_.getParameter("WidthLutInvZ")), + kfNumTracks_(pSetKF_.getParameter("NumTracks")), + kfMinLayers_(pSetKF_.getParameter("MinLayers")), + kfMaxLayers_(pSetKF_.getParameter("MaxLayers")), + kfMaxStubsPerLayer_(pSetKF_.getParameter("MaxStubsPerLayer")), + kfMaxSkippedLayers_(pSetKF_.getParameter("MaxSkippedLayers")), + kfBaseShiftr0_(pSetKF_.getParameter("BaseShiftr0")), + kfBaseShiftr02_(pSetKF_.getParameter("BaseShiftr02")), + kfBaseShiftv0_(pSetKF_.getParameter("BaseShiftv0")), + kfBaseShiftS00_(pSetKF_.getParameter("BaseShiftS00")), + kfBaseShiftS01_(pSetKF_.getParameter("BaseShiftS01")), + kfBaseShiftK00_(pSetKF_.getParameter("BaseShiftK00")), + kfBaseShiftK10_(pSetKF_.getParameter("BaseShiftK10")), + kfBaseShiftR00_(pSetKF_.getParameter("BaseShiftR00")), + kfBaseShiftInvR00_(pSetKF_.getParameter("BaseShiftInvR00")), + kfBaseShiftChi20_(pSetKF_.getParameter("BaseShiftChi20")), + kfBaseShiftC00_(pSetKF_.getParameter("BaseShiftC00")), + kfBaseShiftC01_(pSetKF_.getParameter("BaseShiftC01")), + kfBaseShiftC11_(pSetKF_.getParameter("BaseShiftC11")), + kfBaseShiftr1_(pSetKF_.getParameter("BaseShiftr1")), + kfBaseShiftr12_(pSetKF_.getParameter("BaseShiftr12")), + kfBaseShiftv1_(pSetKF_.getParameter("BaseShiftv1")), + kfBaseShiftS12_(pSetKF_.getParameter("BaseShiftS12")), + kfBaseShiftS13_(pSetKF_.getParameter("BaseShiftS13")), + kfBaseShiftK21_(pSetKF_.getParameter("BaseShiftK21")), + kfBaseShiftK31_(pSetKF_.getParameter("BaseShiftK31")), + kfBaseShiftR11_(pSetKF_.getParameter("BaseShiftR11")), + kfBaseShiftInvR11_(pSetKF_.getParameter("BaseShiftInvR11")), + kfBaseShiftChi21_(pSetKF_.getParameter("BaseShiftChi21")), + kfBaseShiftC22_(pSetKF_.getParameter("BaseShiftC22")), + kfBaseShiftC23_(pSetKF_.getParameter("BaseShiftC23")), + kfBaseShiftC33_(pSetKF_.getParameter("BaseShiftC33")), + kfBaseShiftChi2_(pSetKF_.getParameter("BaseShiftChi2")), + // Parmeter specifying DuplicateRemoval + pSetDR_(iConfig.getParameter("DuplicateRemoval")), + drDepthMemory_(pSetDR_.getParameter("DepthMemory")), + drWidthPhi0_(pSetDR_.getParameter("WidthPhi0")), + drWidthQoverPt_(pSetDR_.getParameter("WidthQoverPt")), + drWidthCot_(pSetDR_.getParameter("WidthCot")), + drWidthZ0_(pSetDR_.getParameter("WidthZ0")) { configurationSupported_ = true; // check if bField is supported checkMagneticField(); @@ -217,7 +217,7 @@ namespace trackerDTC { // create sensor modules produceSensorModules(); } - + // checks current configuration vs input sample configuration void Setup::checkHistory(const ProcessHistory& processHistory) const { const pset::Registry* psetRegistry = pset::Registry::instance(); @@ -226,7 +226,7 @@ namespace trackerDTC { // check used GeometryConfiguration in input producer checkHistory(processHistory, psetRegistry, phGeometryConfiguration_, pSetIdGeometryConfiguration_); } - + // checks consitency between history and current configuration for a specific module void Setup::checkHistory(const ProcessHistory& ph, const pset::Registry* pr, @@ -258,7 +258,7 @@ namespace trackerDTC { throw exception; } } - + // dumps pSetHistory where incosistent lines with pSetProcess are highlighted string Setup::dumpDiff(const ParameterSet& pSetHistory, const ParameterSet& pSetProcess) const { stringstream ssHistory, ssProcess, ss; @@ -269,7 +269,7 @@ namespace trackerDTC { ss << (lineHistory != lineProcess ? "\033[1;31m" : "") << lineHistory << "\033[0m" << endl; return ss.str(); } - + // converts tk layout id into dtc id int Setup::dtcId(int tkLayoutId) const { checkTKLayoutId(tkLayoutId); @@ -279,7 +279,7 @@ namespace trackerDTC { const int slot = tkId % numATCASlots_; return region * numDTCsPerRegion_ + side * numATCASlots_ + slot; } - + // converts dtc id into tk layout id int Setup::tkLayoutId(int dtcId) const { checkDTCId(dtcId); @@ -288,7 +288,7 @@ namespace trackerDTC { const int side = (dtcId % numDTCsPerRegion_) / numATCASlots_; return (side * numRegions_ + region) * numATCASlots_ + slot + 1; } - + // converts TFP identifier (region[0-8], channel[0-47]) into dtc id int Setup::dtcId(int tfpRegion, int tfpChannel) const { checkTFPIdentifier(tfpRegion, tfpChannel); @@ -297,14 +297,14 @@ namespace trackerDTC { const int dtcRegion = tfpRegion - dtcChannel >= 0 ? tfpRegion - dtcChannel : tfpRegion - dtcChannel + numRegions_; return dtcRegion * numDTCsPerRegion_ + dtcBoard; } - + // checks if given DTC id is connected to PS or 2S sensormodules bool Setup::psModule(int dtcId) const { checkDTCId(dtcId); // from tklayout: first 3 are 10 gbps PS, next 3 are 5 gbps PS and residual 6 are 5 gbps 2S modules return slot(dtcId) < numATCASlots_ / 2; } - + // checks if given dtcId is connected to -z (false) or +z (true) bool Setup::side(int dtcId) const { checkDTCId(dtcId); @@ -312,13 +312,13 @@ namespace trackerDTC { // from tkLayout: first 12 +z, next 12 -z return side == 0; } - + // ATCA slot number [0-11] of given dtcId int Setup::slot(int dtcId) const { checkDTCId(dtcId); return dtcId % numATCASlots_; } - + // sensor module for det id SensorModule* Setup::sensorModule(const DetId& detId) const { const auto it = detIdToSensorModule_.find(detId); @@ -330,34 +330,34 @@ namespace trackerDTC { } return it->second; } - + // index = encoded bend, value = decoded bend for given window size and module type const vector& Setup::encodingBend(int windowSize, bool psModule) const { const vector>& encodingsBend = psModule ? encodingsBendPS_ : encodingsBend2S_; return encodingsBend.at(windowSize); } - + // index = encoded layerId, inner value = decoded layerId for given dtcId or tfp channel const vector& Setup::encodingLayerId(int dtcId) const { const int index = dtcId % numDTCsPerRegion_; return encodingsLayerId_.at(index); } - + // check if bField is supported void Setup::checkMagneticField() { const double bFieldES = magneticField_->inTesla(GlobalPoint(0., 0., 0.)).z(); if (abs(bField_ - bFieldES) > bFieldError_) { configurationSupported_ = false; LogWarning("ConfigurationNotSupported") - << "Magnetic Field from EventSetup (" << bFieldES << ") differs more then " << bFieldError_ - << " from supported value (" << bField_ << "). "; + << "Magnetic Field from EventSetup (" << bFieldES << ") differs more then " << bFieldError_ + << " from supported value (" << bField_ << "). "; } } - + // check if geometry is supported void Setup::checkGeometry() { //FIX ME: Can we assume that geometry used in dd4hep wf supports L1Track? - if (!fromDD4hep_){ + if (!fromDD4hep_) { const vector& geomXMLFiles = pSetGC_->getParameter>(sgXMLLabel_); string version; for (const string& geomXMLFile : geomXMLFiles) { @@ -398,7 +398,7 @@ namespace trackerDTC { for (const auto& window : windows) maxWindowSize_ = max(maxWindowSize_, (int)(window / baseWindowSize_)); } - + // create bend encodings void Setup::encodeBend(vector>& encodings, bool ps) const { for (int window = 0; window < maxWindowSize_ + 1; window++) { @@ -408,7 +408,7 @@ namespace trackerDTC { encodings.emplace_back(encoding.begin(), encoding.end()); } } - + // create encodingsLayerId void Setup::encodeLayerId() { vector> dtcELinkIds(numDTCs_); @@ -424,7 +424,7 @@ namespace trackerDTC { const DetId& detId = cablingMap_->dtcELinkIdToDetId(dtcLinkId)->second; const bool barrel = detId.subdetId() == StripSubdetector::TOB; const int layerId = - barrel ? trackerTopology_->layer(detId) : trackerTopology_->tidWheel(detId) + offsetLayerDisks_; + barrel ? trackerTopology_->layer(detId) : trackerTopology_->tidWheel(detId) + offsetLayerDisks_; encodingLayerId.insert(layerId); } } @@ -438,7 +438,7 @@ namespace trackerDTC { encodingsLayerId_.emplace_back(encodingLayerId.begin(), encodingLayerId.end()); } } - + // create sensor modules void Setup::produceSensorModules() { sensorModules_.reserve(numModules_); @@ -480,7 +480,7 @@ namespace trackerDTC { } } } - + // derive constants void Setup::calculateConstants() { // emp @@ -522,7 +522,7 @@ namespace trackerDTC { // hybrid const double hybridRangeQoverPt = 2. * invPtToDphi_ / hybridMinPt_; const double hybridRangeR = - 2. * max(abs(outerRadius_ - hybridChosenRofPhi_), abs(innerRadius_ - hybridChosenRofPhi_)); + 2. * max(abs(outerRadius_ - hybridChosenRofPhi_), abs(innerRadius_ - hybridChosenRofPhi_)); const double hybridRangePhi = baseRegion_ + hybridRangeR * hybridRangeQoverPt / 2.; hybridWidthLayer_ = ceil(log2(hybridNumLayers_)); hybridBasesZ_.reserve(SensorModule::NumTypes); @@ -563,7 +563,7 @@ namespace trackerDTC { const double maxM = atan2(x1, innerRadius_) - atan2(x0, innerRadius_); dtcWidthM_ = ceil(log2(maxM / dtcBaseM_)); dtcNumUnusedBits_ = TTBV::S - 1 - widthR_ - widthPhiDTC_ - widthZ_ - 2 * htWidthQoverPt_ - 2 * widthSectorEta_ - - numSectorsPhi_ - widthLayer_; + numSectorsPhi_ - widthLayer_; // mht mhtNumCells_ = mhtNumBinsQoverPt_ * mhtNumBinsPhiT_; mhtWidthQoverPt_ = ceil(log2(htNumBinsQoverPt_ * mhtNumBinsQoverPt_)); @@ -615,7 +615,7 @@ namespace trackerDTC { kfBaseC23_ = pow(2, kfBaseShiftC23_) * kfBasex2_ * kfBasex3_; kfBaseC33_ = pow(2, kfBaseShiftC33_) * kfBasex3_ * kfBasex3_; } - + // returns bit accurate position of a stub from a given tfp identifier region [0-8] channel [0-47] GlobalPoint Setup::stubPos(bool hybrid, const TTDTC::Frame& frame, int tfpRegion, int tfpChannel) const { GlobalPoint p; @@ -628,7 +628,7 @@ namespace trackerDTC { const bool barrel = detId.subdetId() == StripSubdetector::TOB; const bool psModule = Setup::psModule(dtcId); const int layerId = - (barrel ? trackerTopology_->layer(detId) : trackerTopology_->tidWheel(detId)) - offsetLayerId_; + (barrel ? trackerTopology_->layer(detId) : trackerTopology_->tidWheel(detId)) - offsetLayerId_; const bool side = Setup::side(dtcId); SensorModule::Type type; if (barrel && psModule) @@ -679,18 +679,18 @@ namespace trackerDTC { } return p; } - + // returns global TTStub position GlobalPoint Setup::stubPos(const TTStubRef& ttStubRef) const { const DetId detId = ttStubRef->getDetId() + offsetDetIdDSV_; const GeomDetUnit* det = trackerGeometry_->idToDetUnit(detId); const PixelTopology* topol = - dynamic_cast(&(dynamic_cast(det)->specificTopology())); + dynamic_cast(&(dynamic_cast(det)->specificTopology())); const Plane& plane = dynamic_cast(det)->surface(); const MeasurementPoint& mp = ttStubRef->clusterRef(0)->findAverageLocalCoordinatesCentered(); return plane.toGlobal(topol->localPosition(mp)); } - + // range check of dtc id void Setup::checkDTCId(int dtcId) const { if (dtcId < 0 || dtcId >= numDTCsPerRegion_ * numRegions_) { @@ -701,7 +701,7 @@ namespace trackerDTC { throw exception; } } - + // range check of tklayout id void Setup::checkTKLayoutId(int tkLayoutId) const { if (tkLayoutId <= 0 || tkLayoutId > numDTCsPerRegion_ * numRegions_) { @@ -712,7 +712,7 @@ namespace trackerDTC { throw exception; } } - + // range check of tfp identifier void Setup::checkTFPIdentifier(int tfpRegion, int tfpChannel) const { const bool oorRegion = tfpRegion >= numRegions_ || tfpRegion < 0; @@ -731,5 +731,5 @@ namespace trackerDTC { throw exception; } } - + } // namespace trackerDTC From adf9a9006a156808920253c2d72568ddd51a87ea Mon Sep 17 00:00:00 2001 From: Norraphat Date: Mon, 21 Feb 2022 16:39:09 +0100 Subject: [PATCH 4/4] try again formatting --- L1Trigger/TrackerDTC/plugins/ProducerES.cc | 55 +-- L1Trigger/TrackerDTC/src/Setup.cc | 426 ++++++++++----------- 2 files changed, 241 insertions(+), 240 deletions(-) diff --git a/L1Trigger/TrackerDTC/plugins/ProducerES.cc b/L1Trigger/TrackerDTC/plugins/ProducerES.cc index 8e66512aacebf..6110f2fd4310e 100644 --- a/L1Trigger/TrackerDTC/plugins/ProducerES.cc +++ b/L1Trigger/TrackerDTC/plugins/ProducerES.cc @@ -14,7 +14,7 @@ using namespace std; using namespace edm; namespace trackerDTC { - + /*! \class trackerDTC::ProducerES * \brief Class to produce setup of Track Trigger emulators * \author Thomas Schuh @@ -25,7 +25,7 @@ namespace trackerDTC { ProducerES(const ParameterSet& iConfig); ~ProducerES() override {} unique_ptr produce(const SetupRcd& setupRcd); - + private: const ParameterSet iConfig_; ESGetToken getTokenTTStubAlgorithm_; @@ -37,7 +37,7 @@ namespace trackerDTC { ESGetToken getTokenGeometryConfigurationDD4hep_; bool fromDD4hep_; }; - + ProducerES::ProducerES(const ParameterSet& iConfig) : iConfig_(iConfig) { fromDD4hep_ = iConfig.getParameter("fromDD4hep"); auto cc = setWhatProduced(this); @@ -51,7 +51,7 @@ namespace trackerDTC { else getTokenGeometryConfiguration_ = cc.consumes(); } - + unique_ptr ProducerES::produce(const SetupRcd& setupRcd) { const MagneticField& magneticField = setupRcd.get(getTokenMagneticField_); const TrackerGeometry& trackerGeometry = setupRcd.get(getTokenTrackerGeometry_); @@ -59,37 +59,38 @@ namespace trackerDTC { const TrackerDetToDTCELinkCablingMap& cablingMap = setupRcd.get(getTokenCablingMap_); const ESHandle handleStubAlgorithm = setupRcd.getHandle(getTokenTTStubAlgorithm_); const ParameterSetID& pSetIdTTStubAlgorithm = handleStubAlgorithm.description()->pid_; - const StubAlgorithmOfficial& stubAlgoritm = *dynamic_cast(&setupRcd.get(getTokenTTStubAlgorithm_)); + const StubAlgorithmOfficial& stubAlgoritm = + *dynamic_cast(&setupRcd.get(getTokenTTStubAlgorithm_)); const ParameterSet& pSetStubAlgorithm = getParameterSet(handleStubAlgorithm.description()->pid_); - if (fromDD4hep_){ - const ESHandle handleGeometryConfiguration = setupRcd.getHandle(getTokenGeometryConfigurationDD4hep_); + if (fromDD4hep_) { + const ESHandle handleGeometryConfiguration = + setupRcd.getHandle(getTokenGeometryConfigurationDD4hep_); const ParameterSetID& pSetIdGeometryConfiguration = handleGeometryConfiguration.description()->pid_; const ParameterSet& pSetGeometryConfiguration = getParameterSet(handleGeometryConfiguration.description()->pid_); return make_unique(iConfig_, - magneticField, - trackerGeometry, - trackerTopology, - cablingMap, - stubAlgoritm, - pSetStubAlgorithm, - pSetGeometryConfiguration, - pSetIdTTStubAlgorithm, - pSetIdGeometryConfiguration); - } - else{ + magneticField, + trackerGeometry, + trackerTopology, + cablingMap, + stubAlgoritm, + pSetStubAlgorithm, + pSetGeometryConfiguration, + pSetIdTTStubAlgorithm, + pSetIdGeometryConfiguration); + } else { const ESHandle handleGeometryConfiguration = setupRcd.getHandle(getTokenGeometryConfiguration_); const ParameterSetID& pSetIdGeometryConfiguration = handleGeometryConfiguration.description()->pid_; const ParameterSet& pSetGeometryConfiguration = getParameterSet(handleGeometryConfiguration.description()->pid_); return make_unique(iConfig_, - magneticField, - trackerGeometry, - trackerTopology, - cablingMap, - stubAlgoritm, - pSetStubAlgorithm, - pSetGeometryConfiguration, - pSetIdTTStubAlgorithm, - pSetIdGeometryConfiguration); + magneticField, + trackerGeometry, + trackerTopology, + cablingMap, + stubAlgoritm, + pSetStubAlgorithm, + pSetGeometryConfiguration, + pSetIdTTStubAlgorithm, + pSetIdGeometryConfiguration); } } } // namespace trackerDTC diff --git a/L1Trigger/TrackerDTC/src/Setup.cc b/L1Trigger/TrackerDTC/src/Setup.cc index 11e3ce977dffc..837bf742803a8 100644 --- a/L1Trigger/TrackerDTC/src/Setup.cc +++ b/L1Trigger/TrackerDTC/src/Setup.cc @@ -15,7 +15,7 @@ using namespace std; using namespace edm; namespace trackerDTC { - + Setup::Setup(const ParameterSet& iConfig, const MagneticField& magneticField, const TrackerGeometry& trackerGeometry, @@ -26,175 +26,175 @@ namespace trackerDTC { const ParameterSet& pSetGeometryConfiguration, const ParameterSetID& pSetIdTTStubAlgorithm, const ParameterSetID& pSetIdGeometryConfiguration) - : magneticField_(&magneticField), - trackerGeometry_(&trackerGeometry), - trackerTopology_(&trackerTopology), - cablingMap_(&cablingMap), - stubAlgorithm_(&stubAlgorithm), - pSetSA_(&pSetStubAlgorithm), - pSetGC_(&pSetGeometryConfiguration), - pSetIdTTStubAlgorithm_(pSetIdTTStubAlgorithm), - pSetIdGeometryConfiguration_(pSetIdGeometryConfiguration), - // DD4hep - fromDD4hep_(iConfig.getParameter("fromDD4hep")), - // Parameter to check if configured Tracker Geometry is supported - pSetSG_(iConfig.getParameter("SupportedGeometry")), - sgXMLLabel_(pSetSG_.getParameter("XMLLabel")), - sgXMLPath_(pSetSG_.getParameter("XMLPath")), - sgXMLFile_(pSetSG_.getParameter("XMLFile")), - sgXMLVersions_(pSetSG_.getParameter>("XMLVersions")), - // Parameter to check if Process History is consistent with process configuration - pSetPH_(iConfig.getParameter("ProcessHistory")), - phGeometryConfiguration_(pSetPH_.getParameter("GeometryConfiguration")), - phTTStubAlgorithm_(pSetPH_.getParameter("TTStubAlgorithm")), - // Common track finding parameter - pSetTF_(iConfig.getParameter("TrackFinding")), - beamWindowZ_(pSetTF_.getParameter("BeamWindowZ")), - matchedLayers_(pSetTF_.getParameter("MatchedLayers")), - matchedLayersPS_(pSetTF_.getParameter("MatchedLayersPS")), - unMatchedStubs_(pSetTF_.getParameter("UnMatchedStubs")), - unMatchedStubsPS_(pSetTF_.getParameter("UnMatchedStubsPS")), - // TMTT specific parameter - pSetTMTT_(iConfig.getParameter("TMTT")), - minPt_(pSetTMTT_.getParameter("MinPt")), - maxEta_(pSetTMTT_.getParameter("MaxEta")), - chosenRofPhi_(pSetTMTT_.getParameter("ChosenRofPhi")), - numLayers_(pSetTMTT_.getParameter("NumLayers")), - widthR_(pSetTMTT_.getParameter("WidthR")), - widthPhi_(pSetTMTT_.getParameter("WidthPhi")), - widthZ_(pSetTMTT_.getParameter("WidthZ")), - // Hybrid specific parameter - pSetHybrid_(iConfig.getParameter("Hybrid")), - hybridMinPt_(pSetHybrid_.getParameter("MinPt")), - hybridMaxEta_(pSetHybrid_.getParameter("MaxEta")), - hybridChosenRofPhi_(pSetHybrid_.getParameter("ChosenRofPhi")), - hybridNumLayers_(pSetHybrid_.getParameter("NumLayers")), - hybridNumRingsPS_(pSetHybrid_.getParameter>("NumRingsPS")), - hybridWidthsR_(pSetHybrid_.getParameter>("WidthsR")), - hybridWidthsZ_(pSetHybrid_.getParameter>("WidthsZ")), - hybridWidthsPhi_(pSetHybrid_.getParameter>("WidthsPhi")), - hybridWidthsAlpha_(pSetHybrid_.getParameter>("WidthsAlpha")), - hybridWidthsBend_(pSetHybrid_.getParameter>("WidthsBend")), - hybridRangesR_(pSetHybrid_.getParameter>("RangesR")), - hybridRangesZ_(pSetHybrid_.getParameter>("RangesZ")), - hybridRangesAlpha_(pSetHybrid_.getParameter>("RangesAlpha")), - hybridLayerRs_(pSetHybrid_.getParameter>("LayerRs")), - hybridDiskZs_(pSetHybrid_.getParameter>("DiskZs")), - hybridDisk2SRsSet_(pSetHybrid_.getParameter>("Disk2SRsSet")), - // Parameter specifying TrackingParticle used for Efficiency measurements - pSetTP_(iConfig.getParameter("TrackingParticle")), - tpMaxEta_(pSetTP_.getParameter("MaxEta")), - tpMaxVertR_(pSetTP_.getParameter("MaxVertR")), - tpMaxVertZ_(pSetTP_.getParameter("MaxVertZ")), - tpMaxD0_(pSetTP_.getParameter("MaxD0")), - tpMinLayers_(pSetTP_.getParameter("MinLayers")), - tpMinLayersPS_(pSetTP_.getParameter("MinLayersPS")), - // Fimrware specific Parameter - pSetFW_(iConfig.getParameter("Firmware")), - numFramesInfra_(pSetFW_.getParameter("NumFramesInfra")), - freqLHC_(pSetFW_.getParameter("FreqLHC")), - freqBE_(pSetFW_.getParameter("FreqBE")), - tmpFE_(pSetFW_.getParameter("TMP_FE")), - tmpTFP_(pSetFW_.getParameter("TMP_TFP")), - speedOfLight_(pSetFW_.getParameter("SpeedOfLight")), - bField_(pSetFW_.getParameter("BField")), - bFieldError_(pSetFW_.getParameter("BFieldError")), - outerRadius_(pSetFW_.getParameter("OuterRadius")), - innerRadius_(pSetFW_.getParameter("InnerRadius")), - halfLength_(pSetFW_.getParameter("HalfLength")), - maxPitch_(pSetFW_.getParameter("MaxPitch")), - // Parmeter specifying front-end - pSetFE_(iConfig.getParameter("FrontEnd")), - widthBend_(pSetFE_.getParameter("WidthBend")), - widthCol_(pSetFE_.getParameter("WidthCol")), - widthRow_(pSetFE_.getParameter("WidthRow")), - baseBend_(pSetFE_.getParameter("BaseBend")), - baseCol_(pSetFE_.getParameter("BaseCol")), - baseRow_(pSetFE_.getParameter("BaseRow")), - baseWindowSize_(pSetFE_.getParameter("BaseWindowSize")), - bendCut_(pSetFE_.getParameter("BendCut")), - // Parmeter specifying DTC - pSetDTC_(iConfig.getParameter("DTC")), - numRegions_(pSetDTC_.getParameter("NumRegions")), - numOverlappingRegions_(pSetDTC_.getParameter("NumOverlappingRegions")), - numATCASlots_(pSetDTC_.getParameter("NumATCASlots")), - numDTCsPerRegion_(pSetDTC_.getParameter("NumDTCsPerRegion")), - numModulesPerDTC_(pSetDTC_.getParameter("NumModulesPerDTC")), - dtcNumRoutingBlocks_(pSetDTC_.getParameter("NumRoutingBlocks")), - dtcDepthMemory_(pSetDTC_.getParameter("DepthMemory")), - dtcWidthRowLUT_(pSetDTC_.getParameter("WidthRowLUT")), - dtcWidthQoverPt_(pSetDTC_.getParameter("WidthQoverPt")), - offsetDetIdDSV_(pSetDTC_.getParameter("OffsetDetIdDSV")), - offsetDetIdTP_(pSetDTC_.getParameter("OffsetDetIdTP")), - offsetLayerDisks_(pSetDTC_.getParameter("OffsetLayerDisks")), - offsetLayerId_(pSetDTC_.getParameter("OffsetLayerId")), - // Parmeter specifying GeometricProcessor - pSetGP_(iConfig.getParameter("GeometricProcessor")), - numSectorsPhi_(pSetGP_.getParameter("NumSectorsPhi")), - chosenRofZ_(pSetGP_.getParameter("ChosenRofZ")), - neededRangeChiZ_(pSetGP_.getParameter("RangeChiZ")), - gpDepthMemory_(pSetGP_.getParameter("DepthMemory")), - boundariesEta_(pSetGP_.getParameter>("BoundariesEta")), - // Parmeter specifying HoughTransform - pSetHT_(iConfig.getParameter("HoughTransform")), - htNumBinsQoverPt_(pSetHT_.getParameter("NumBinsQoverPt")), - htNumBinsPhiT_(pSetHT_.getParameter("NumBinsPhiT")), - htMinLayers_(pSetHT_.getParameter("MinLayers")), - htDepthMemory_(pSetHT_.getParameter("DepthMemory")), - // Parmeter specifying MiniHoughTransform - pSetMHT_(iConfig.getParameter("MiniHoughTransform")), - mhtNumBinsQoverPt_(pSetMHT_.getParameter("NumBinsQoverPt")), - mhtNumBinsPhiT_(pSetMHT_.getParameter("NumBinsPhiT")), - mhtNumDLB_(pSetMHT_.getParameter("NumDLB")), - mhtMinLayers_(pSetMHT_.getParameter("MinLayers")), - // Parmeter specifying SeedFilter - pSetSF_(iConfig.getParameter("SeedFilter")), - sfPowerBaseCot_(pSetSF_.getParameter("PowerBaseCot")), - sfBaseDiffZ_(pSetSF_.getParameter("BaseDiffZ")), - sfMinLayers_(pSetSF_.getParameter("MinLayers")), - // Parmeter specifying KalmanFilter - pSetKF_(iConfig.getParameter("KalmanFilter")), - kfWidthLutInvPhi_(pSetKF_.getParameter("WidthLutInvPhi")), - kfWidthLutInvZ_(pSetKF_.getParameter("WidthLutInvZ")), - kfNumTracks_(pSetKF_.getParameter("NumTracks")), - kfMinLayers_(pSetKF_.getParameter("MinLayers")), - kfMaxLayers_(pSetKF_.getParameter("MaxLayers")), - kfMaxStubsPerLayer_(pSetKF_.getParameter("MaxStubsPerLayer")), - kfMaxSkippedLayers_(pSetKF_.getParameter("MaxSkippedLayers")), - kfBaseShiftr0_(pSetKF_.getParameter("BaseShiftr0")), - kfBaseShiftr02_(pSetKF_.getParameter("BaseShiftr02")), - kfBaseShiftv0_(pSetKF_.getParameter("BaseShiftv0")), - kfBaseShiftS00_(pSetKF_.getParameter("BaseShiftS00")), - kfBaseShiftS01_(pSetKF_.getParameter("BaseShiftS01")), - kfBaseShiftK00_(pSetKF_.getParameter("BaseShiftK00")), - kfBaseShiftK10_(pSetKF_.getParameter("BaseShiftK10")), - kfBaseShiftR00_(pSetKF_.getParameter("BaseShiftR00")), - kfBaseShiftInvR00_(pSetKF_.getParameter("BaseShiftInvR00")), - kfBaseShiftChi20_(pSetKF_.getParameter("BaseShiftChi20")), - kfBaseShiftC00_(pSetKF_.getParameter("BaseShiftC00")), - kfBaseShiftC01_(pSetKF_.getParameter("BaseShiftC01")), - kfBaseShiftC11_(pSetKF_.getParameter("BaseShiftC11")), - kfBaseShiftr1_(pSetKF_.getParameter("BaseShiftr1")), - kfBaseShiftr12_(pSetKF_.getParameter("BaseShiftr12")), - kfBaseShiftv1_(pSetKF_.getParameter("BaseShiftv1")), - kfBaseShiftS12_(pSetKF_.getParameter("BaseShiftS12")), - kfBaseShiftS13_(pSetKF_.getParameter("BaseShiftS13")), - kfBaseShiftK21_(pSetKF_.getParameter("BaseShiftK21")), - kfBaseShiftK31_(pSetKF_.getParameter("BaseShiftK31")), - kfBaseShiftR11_(pSetKF_.getParameter("BaseShiftR11")), - kfBaseShiftInvR11_(pSetKF_.getParameter("BaseShiftInvR11")), - kfBaseShiftChi21_(pSetKF_.getParameter("BaseShiftChi21")), - kfBaseShiftC22_(pSetKF_.getParameter("BaseShiftC22")), - kfBaseShiftC23_(pSetKF_.getParameter("BaseShiftC23")), - kfBaseShiftC33_(pSetKF_.getParameter("BaseShiftC33")), - kfBaseShiftChi2_(pSetKF_.getParameter("BaseShiftChi2")), - // Parmeter specifying DuplicateRemoval - pSetDR_(iConfig.getParameter("DuplicateRemoval")), - drDepthMemory_(pSetDR_.getParameter("DepthMemory")), - drWidthPhi0_(pSetDR_.getParameter("WidthPhi0")), - drWidthQoverPt_(pSetDR_.getParameter("WidthQoverPt")), - drWidthCot_(pSetDR_.getParameter("WidthCot")), - drWidthZ0_(pSetDR_.getParameter("WidthZ0")) { + : magneticField_(&magneticField), + trackerGeometry_(&trackerGeometry), + trackerTopology_(&trackerTopology), + cablingMap_(&cablingMap), + stubAlgorithm_(&stubAlgorithm), + pSetSA_(&pSetStubAlgorithm), + pSetGC_(&pSetGeometryConfiguration), + pSetIdTTStubAlgorithm_(pSetIdTTStubAlgorithm), + pSetIdGeometryConfiguration_(pSetIdGeometryConfiguration), + // DD4hep + fromDD4hep_(iConfig.getParameter("fromDD4hep")), + // Parameter to check if configured Tracker Geometry is supported + pSetSG_(iConfig.getParameter("SupportedGeometry")), + sgXMLLabel_(pSetSG_.getParameter("XMLLabel")), + sgXMLPath_(pSetSG_.getParameter("XMLPath")), + sgXMLFile_(pSetSG_.getParameter("XMLFile")), + sgXMLVersions_(pSetSG_.getParameter>("XMLVersions")), + // Parameter to check if Process History is consistent with process configuration + pSetPH_(iConfig.getParameter("ProcessHistory")), + phGeometryConfiguration_(pSetPH_.getParameter("GeometryConfiguration")), + phTTStubAlgorithm_(pSetPH_.getParameter("TTStubAlgorithm")), + // Common track finding parameter + pSetTF_(iConfig.getParameter("TrackFinding")), + beamWindowZ_(pSetTF_.getParameter("BeamWindowZ")), + matchedLayers_(pSetTF_.getParameter("MatchedLayers")), + matchedLayersPS_(pSetTF_.getParameter("MatchedLayersPS")), + unMatchedStubs_(pSetTF_.getParameter("UnMatchedStubs")), + unMatchedStubsPS_(pSetTF_.getParameter("UnMatchedStubsPS")), + // TMTT specific parameter + pSetTMTT_(iConfig.getParameter("TMTT")), + minPt_(pSetTMTT_.getParameter("MinPt")), + maxEta_(pSetTMTT_.getParameter("MaxEta")), + chosenRofPhi_(pSetTMTT_.getParameter("ChosenRofPhi")), + numLayers_(pSetTMTT_.getParameter("NumLayers")), + widthR_(pSetTMTT_.getParameter("WidthR")), + widthPhi_(pSetTMTT_.getParameter("WidthPhi")), + widthZ_(pSetTMTT_.getParameter("WidthZ")), + // Hybrid specific parameter + pSetHybrid_(iConfig.getParameter("Hybrid")), + hybridMinPt_(pSetHybrid_.getParameter("MinPt")), + hybridMaxEta_(pSetHybrid_.getParameter("MaxEta")), + hybridChosenRofPhi_(pSetHybrid_.getParameter("ChosenRofPhi")), + hybridNumLayers_(pSetHybrid_.getParameter("NumLayers")), + hybridNumRingsPS_(pSetHybrid_.getParameter>("NumRingsPS")), + hybridWidthsR_(pSetHybrid_.getParameter>("WidthsR")), + hybridWidthsZ_(pSetHybrid_.getParameter>("WidthsZ")), + hybridWidthsPhi_(pSetHybrid_.getParameter>("WidthsPhi")), + hybridWidthsAlpha_(pSetHybrid_.getParameter>("WidthsAlpha")), + hybridWidthsBend_(pSetHybrid_.getParameter>("WidthsBend")), + hybridRangesR_(pSetHybrid_.getParameter>("RangesR")), + hybridRangesZ_(pSetHybrid_.getParameter>("RangesZ")), + hybridRangesAlpha_(pSetHybrid_.getParameter>("RangesAlpha")), + hybridLayerRs_(pSetHybrid_.getParameter>("LayerRs")), + hybridDiskZs_(pSetHybrid_.getParameter>("DiskZs")), + hybridDisk2SRsSet_(pSetHybrid_.getParameter>("Disk2SRsSet")), + // Parameter specifying TrackingParticle used for Efficiency measurements + pSetTP_(iConfig.getParameter("TrackingParticle")), + tpMaxEta_(pSetTP_.getParameter("MaxEta")), + tpMaxVertR_(pSetTP_.getParameter("MaxVertR")), + tpMaxVertZ_(pSetTP_.getParameter("MaxVertZ")), + tpMaxD0_(pSetTP_.getParameter("MaxD0")), + tpMinLayers_(pSetTP_.getParameter("MinLayers")), + tpMinLayersPS_(pSetTP_.getParameter("MinLayersPS")), + // Fimrware specific Parameter + pSetFW_(iConfig.getParameter("Firmware")), + numFramesInfra_(pSetFW_.getParameter("NumFramesInfra")), + freqLHC_(pSetFW_.getParameter("FreqLHC")), + freqBE_(pSetFW_.getParameter("FreqBE")), + tmpFE_(pSetFW_.getParameter("TMP_FE")), + tmpTFP_(pSetFW_.getParameter("TMP_TFP")), + speedOfLight_(pSetFW_.getParameter("SpeedOfLight")), + bField_(pSetFW_.getParameter("BField")), + bFieldError_(pSetFW_.getParameter("BFieldError")), + outerRadius_(pSetFW_.getParameter("OuterRadius")), + innerRadius_(pSetFW_.getParameter("InnerRadius")), + halfLength_(pSetFW_.getParameter("HalfLength")), + maxPitch_(pSetFW_.getParameter("MaxPitch")), + // Parmeter specifying front-end + pSetFE_(iConfig.getParameter("FrontEnd")), + widthBend_(pSetFE_.getParameter("WidthBend")), + widthCol_(pSetFE_.getParameter("WidthCol")), + widthRow_(pSetFE_.getParameter("WidthRow")), + baseBend_(pSetFE_.getParameter("BaseBend")), + baseCol_(pSetFE_.getParameter("BaseCol")), + baseRow_(pSetFE_.getParameter("BaseRow")), + baseWindowSize_(pSetFE_.getParameter("BaseWindowSize")), + bendCut_(pSetFE_.getParameter("BendCut")), + // Parmeter specifying DTC + pSetDTC_(iConfig.getParameter("DTC")), + numRegions_(pSetDTC_.getParameter("NumRegions")), + numOverlappingRegions_(pSetDTC_.getParameter("NumOverlappingRegions")), + numATCASlots_(pSetDTC_.getParameter("NumATCASlots")), + numDTCsPerRegion_(pSetDTC_.getParameter("NumDTCsPerRegion")), + numModulesPerDTC_(pSetDTC_.getParameter("NumModulesPerDTC")), + dtcNumRoutingBlocks_(pSetDTC_.getParameter("NumRoutingBlocks")), + dtcDepthMemory_(pSetDTC_.getParameter("DepthMemory")), + dtcWidthRowLUT_(pSetDTC_.getParameter("WidthRowLUT")), + dtcWidthQoverPt_(pSetDTC_.getParameter("WidthQoverPt")), + offsetDetIdDSV_(pSetDTC_.getParameter("OffsetDetIdDSV")), + offsetDetIdTP_(pSetDTC_.getParameter("OffsetDetIdTP")), + offsetLayerDisks_(pSetDTC_.getParameter("OffsetLayerDisks")), + offsetLayerId_(pSetDTC_.getParameter("OffsetLayerId")), + // Parmeter specifying GeometricProcessor + pSetGP_(iConfig.getParameter("GeometricProcessor")), + numSectorsPhi_(pSetGP_.getParameter("NumSectorsPhi")), + chosenRofZ_(pSetGP_.getParameter("ChosenRofZ")), + neededRangeChiZ_(pSetGP_.getParameter("RangeChiZ")), + gpDepthMemory_(pSetGP_.getParameter("DepthMemory")), + boundariesEta_(pSetGP_.getParameter>("BoundariesEta")), + // Parmeter specifying HoughTransform + pSetHT_(iConfig.getParameter("HoughTransform")), + htNumBinsQoverPt_(pSetHT_.getParameter("NumBinsQoverPt")), + htNumBinsPhiT_(pSetHT_.getParameter("NumBinsPhiT")), + htMinLayers_(pSetHT_.getParameter("MinLayers")), + htDepthMemory_(pSetHT_.getParameter("DepthMemory")), + // Parmeter specifying MiniHoughTransform + pSetMHT_(iConfig.getParameter("MiniHoughTransform")), + mhtNumBinsQoverPt_(pSetMHT_.getParameter("NumBinsQoverPt")), + mhtNumBinsPhiT_(pSetMHT_.getParameter("NumBinsPhiT")), + mhtNumDLB_(pSetMHT_.getParameter("NumDLB")), + mhtMinLayers_(pSetMHT_.getParameter("MinLayers")), + // Parmeter specifying SeedFilter + pSetSF_(iConfig.getParameter("SeedFilter")), + sfPowerBaseCot_(pSetSF_.getParameter("PowerBaseCot")), + sfBaseDiffZ_(pSetSF_.getParameter("BaseDiffZ")), + sfMinLayers_(pSetSF_.getParameter("MinLayers")), + // Parmeter specifying KalmanFilter + pSetKF_(iConfig.getParameter("KalmanFilter")), + kfWidthLutInvPhi_(pSetKF_.getParameter("WidthLutInvPhi")), + kfWidthLutInvZ_(pSetKF_.getParameter("WidthLutInvZ")), + kfNumTracks_(pSetKF_.getParameter("NumTracks")), + kfMinLayers_(pSetKF_.getParameter("MinLayers")), + kfMaxLayers_(pSetKF_.getParameter("MaxLayers")), + kfMaxStubsPerLayer_(pSetKF_.getParameter("MaxStubsPerLayer")), + kfMaxSkippedLayers_(pSetKF_.getParameter("MaxSkippedLayers")), + kfBaseShiftr0_(pSetKF_.getParameter("BaseShiftr0")), + kfBaseShiftr02_(pSetKF_.getParameter("BaseShiftr02")), + kfBaseShiftv0_(pSetKF_.getParameter("BaseShiftv0")), + kfBaseShiftS00_(pSetKF_.getParameter("BaseShiftS00")), + kfBaseShiftS01_(pSetKF_.getParameter("BaseShiftS01")), + kfBaseShiftK00_(pSetKF_.getParameter("BaseShiftK00")), + kfBaseShiftK10_(pSetKF_.getParameter("BaseShiftK10")), + kfBaseShiftR00_(pSetKF_.getParameter("BaseShiftR00")), + kfBaseShiftInvR00_(pSetKF_.getParameter("BaseShiftInvR00")), + kfBaseShiftChi20_(pSetKF_.getParameter("BaseShiftChi20")), + kfBaseShiftC00_(pSetKF_.getParameter("BaseShiftC00")), + kfBaseShiftC01_(pSetKF_.getParameter("BaseShiftC01")), + kfBaseShiftC11_(pSetKF_.getParameter("BaseShiftC11")), + kfBaseShiftr1_(pSetKF_.getParameter("BaseShiftr1")), + kfBaseShiftr12_(pSetKF_.getParameter("BaseShiftr12")), + kfBaseShiftv1_(pSetKF_.getParameter("BaseShiftv1")), + kfBaseShiftS12_(pSetKF_.getParameter("BaseShiftS12")), + kfBaseShiftS13_(pSetKF_.getParameter("BaseShiftS13")), + kfBaseShiftK21_(pSetKF_.getParameter("BaseShiftK21")), + kfBaseShiftK31_(pSetKF_.getParameter("BaseShiftK31")), + kfBaseShiftR11_(pSetKF_.getParameter("BaseShiftR11")), + kfBaseShiftInvR11_(pSetKF_.getParameter("BaseShiftInvR11")), + kfBaseShiftChi21_(pSetKF_.getParameter("BaseShiftChi21")), + kfBaseShiftC22_(pSetKF_.getParameter("BaseShiftC22")), + kfBaseShiftC23_(pSetKF_.getParameter("BaseShiftC23")), + kfBaseShiftC33_(pSetKF_.getParameter("BaseShiftC33")), + kfBaseShiftChi2_(pSetKF_.getParameter("BaseShiftChi2")), + // Parmeter specifying DuplicateRemoval + pSetDR_(iConfig.getParameter("DuplicateRemoval")), + drDepthMemory_(pSetDR_.getParameter("DepthMemory")), + drWidthPhi0_(pSetDR_.getParameter("WidthPhi0")), + drWidthQoverPt_(pSetDR_.getParameter("WidthQoverPt")), + drWidthCot_(pSetDR_.getParameter("WidthCot")), + drWidthZ0_(pSetDR_.getParameter("WidthZ0")) { configurationSupported_ = true; // check if bField is supported checkMagneticField(); @@ -217,7 +217,7 @@ namespace trackerDTC { // create sensor modules produceSensorModules(); } - + // checks current configuration vs input sample configuration void Setup::checkHistory(const ProcessHistory& processHistory) const { const pset::Registry* psetRegistry = pset::Registry::instance(); @@ -226,7 +226,7 @@ namespace trackerDTC { // check used GeometryConfiguration in input producer checkHistory(processHistory, psetRegistry, phGeometryConfiguration_, pSetIdGeometryConfiguration_); } - + // checks consitency between history and current configuration for a specific module void Setup::checkHistory(const ProcessHistory& ph, const pset::Registry* pr, @@ -258,7 +258,7 @@ namespace trackerDTC { throw exception; } } - + // dumps pSetHistory where incosistent lines with pSetProcess are highlighted string Setup::dumpDiff(const ParameterSet& pSetHistory, const ParameterSet& pSetProcess) const { stringstream ssHistory, ssProcess, ss; @@ -269,7 +269,7 @@ namespace trackerDTC { ss << (lineHistory != lineProcess ? "\033[1;31m" : "") << lineHistory << "\033[0m" << endl; return ss.str(); } - + // converts tk layout id into dtc id int Setup::dtcId(int tkLayoutId) const { checkTKLayoutId(tkLayoutId); @@ -279,7 +279,7 @@ namespace trackerDTC { const int slot = tkId % numATCASlots_; return region * numDTCsPerRegion_ + side * numATCASlots_ + slot; } - + // converts dtc id into tk layout id int Setup::tkLayoutId(int dtcId) const { checkDTCId(dtcId); @@ -288,7 +288,7 @@ namespace trackerDTC { const int side = (dtcId % numDTCsPerRegion_) / numATCASlots_; return (side * numRegions_ + region) * numATCASlots_ + slot + 1; } - + // converts TFP identifier (region[0-8], channel[0-47]) into dtc id int Setup::dtcId(int tfpRegion, int tfpChannel) const { checkTFPIdentifier(tfpRegion, tfpChannel); @@ -297,14 +297,14 @@ namespace trackerDTC { const int dtcRegion = tfpRegion - dtcChannel >= 0 ? tfpRegion - dtcChannel : tfpRegion - dtcChannel + numRegions_; return dtcRegion * numDTCsPerRegion_ + dtcBoard; } - + // checks if given DTC id is connected to PS or 2S sensormodules bool Setup::psModule(int dtcId) const { checkDTCId(dtcId); // from tklayout: first 3 are 10 gbps PS, next 3 are 5 gbps PS and residual 6 are 5 gbps 2S modules return slot(dtcId) < numATCASlots_ / 2; } - + // checks if given dtcId is connected to -z (false) or +z (true) bool Setup::side(int dtcId) const { checkDTCId(dtcId); @@ -312,13 +312,13 @@ namespace trackerDTC { // from tkLayout: first 12 +z, next 12 -z return side == 0; } - + // ATCA slot number [0-11] of given dtcId int Setup::slot(int dtcId) const { checkDTCId(dtcId); return dtcId % numATCASlots_; } - + // sensor module for det id SensorModule* Setup::sensorModule(const DetId& detId) const { const auto it = detIdToSensorModule_.find(detId); @@ -330,30 +330,30 @@ namespace trackerDTC { } return it->second; } - + // index = encoded bend, value = decoded bend for given window size and module type const vector& Setup::encodingBend(int windowSize, bool psModule) const { const vector>& encodingsBend = psModule ? encodingsBendPS_ : encodingsBend2S_; return encodingsBend.at(windowSize); } - + // index = encoded layerId, inner value = decoded layerId for given dtcId or tfp channel const vector& Setup::encodingLayerId(int dtcId) const { const int index = dtcId % numDTCsPerRegion_; return encodingsLayerId_.at(index); } - + // check if bField is supported void Setup::checkMagneticField() { const double bFieldES = magneticField_->inTesla(GlobalPoint(0., 0., 0.)).z(); if (abs(bField_ - bFieldES) > bFieldError_) { configurationSupported_ = false; LogWarning("ConfigurationNotSupported") - << "Magnetic Field from EventSetup (" << bFieldES << ") differs more then " << bFieldError_ - << " from supported value (" << bField_ << "). "; + << "Magnetic Field from EventSetup (" << bFieldES << ") differs more then " << bFieldError_ + << " from supported value (" << bField_ << "). "; } } - + // check if geometry is supported void Setup::checkGeometry() { //FIX ME: Can we assume that geometry used in dd4hep wf supports L1Track? @@ -361,25 +361,25 @@ namespace trackerDTC { const vector& geomXMLFiles = pSetGC_->getParameter>(sgXMLLabel_); string version; for (const string& geomXMLFile : geomXMLFiles) { - const auto begin = geomXMLFile.find(sgXMLPath_) + sgXMLPath_.size(); - const auto end = geomXMLFile.find(sgXMLFile_); - if (begin != string::npos && end != string::npos) - version = geomXMLFile.substr(begin, end - begin - 1); + const auto begin = geomXMLFile.find(sgXMLPath_) + sgXMLPath_.size(); + const auto end = geomXMLFile.find(sgXMLFile_); + if (begin != string::npos && end != string::npos) + version = geomXMLFile.substr(begin, end - begin - 1); } if (version.empty()) { - cms::Exception exception("LogicError"); - exception << "No " << sgXMLPath_ << "*/" << sgXMLFile_ << " found in GeometryConfiguration"; - exception.addContext("tt::Setup::checkGeometry"); - throw exception; + cms::Exception exception("LogicError"); + exception << "No " << sgXMLPath_ << "*/" << sgXMLFile_ << " found in GeometryConfiguration"; + exception.addContext("tt::Setup::checkGeometry"); + throw exception; } if (find(sgXMLVersions_.begin(), sgXMLVersions_.end(), version) == sgXMLVersions_.end()) { - configurationSupported_ = false; - LogWarning("ConfigurationNotSupported") - << "Geometry Configuration " << sgXMLPath_ << version << "/" << sgXMLFile_ << " is not supported. "; + configurationSupported_ = false; + LogWarning("ConfigurationNotSupported") + << "Geometry Configuration " << sgXMLPath_ << version << "/" << sgXMLFile_ << " is not supported. "; } } } - + // convert configuration of TTStubAlgorithm void Setup::consumeStubAlgorithm() { numTiltedLayerRings_ = pSetSA_->getParameter>("NTiltedRings"); @@ -398,7 +398,7 @@ namespace trackerDTC { for (const auto& window : windows) maxWindowSize_ = max(maxWindowSize_, (int)(window / baseWindowSize_)); } - + // create bend encodings void Setup::encodeBend(vector>& encodings, bool ps) const { for (int window = 0; window < maxWindowSize_ + 1; window++) { @@ -408,7 +408,7 @@ namespace trackerDTC { encodings.emplace_back(encoding.begin(), encoding.end()); } } - + // create encodingsLayerId void Setup::encodeLayerId() { vector> dtcELinkIds(numDTCs_); @@ -424,7 +424,7 @@ namespace trackerDTC { const DetId& detId = cablingMap_->dtcELinkIdToDetId(dtcLinkId)->second; const bool barrel = detId.subdetId() == StripSubdetector::TOB; const int layerId = - barrel ? trackerTopology_->layer(detId) : trackerTopology_->tidWheel(detId) + offsetLayerDisks_; + barrel ? trackerTopology_->layer(detId) : trackerTopology_->tidWheel(detId) + offsetLayerDisks_; encodingLayerId.insert(layerId); } } @@ -438,7 +438,7 @@ namespace trackerDTC { encodingsLayerId_.emplace_back(encodingLayerId.begin(), encodingLayerId.end()); } } - + // create sensor modules void Setup::produceSensorModules() { sensorModules_.reserve(numModules_); @@ -480,7 +480,7 @@ namespace trackerDTC { } } } - + // derive constants void Setup::calculateConstants() { // emp @@ -522,7 +522,7 @@ namespace trackerDTC { // hybrid const double hybridRangeQoverPt = 2. * invPtToDphi_ / hybridMinPt_; const double hybridRangeR = - 2. * max(abs(outerRadius_ - hybridChosenRofPhi_), abs(innerRadius_ - hybridChosenRofPhi_)); + 2. * max(abs(outerRadius_ - hybridChosenRofPhi_), abs(innerRadius_ - hybridChosenRofPhi_)); const double hybridRangePhi = baseRegion_ + hybridRangeR * hybridRangeQoverPt / 2.; hybridWidthLayer_ = ceil(log2(hybridNumLayers_)); hybridBasesZ_.reserve(SensorModule::NumTypes); @@ -563,7 +563,7 @@ namespace trackerDTC { const double maxM = atan2(x1, innerRadius_) - atan2(x0, innerRadius_); dtcWidthM_ = ceil(log2(maxM / dtcBaseM_)); dtcNumUnusedBits_ = TTBV::S - 1 - widthR_ - widthPhiDTC_ - widthZ_ - 2 * htWidthQoverPt_ - 2 * widthSectorEta_ - - numSectorsPhi_ - widthLayer_; + numSectorsPhi_ - widthLayer_; // mht mhtNumCells_ = mhtNumBinsQoverPt_ * mhtNumBinsPhiT_; mhtWidthQoverPt_ = ceil(log2(htNumBinsQoverPt_ * mhtNumBinsQoverPt_)); @@ -615,7 +615,7 @@ namespace trackerDTC { kfBaseC23_ = pow(2, kfBaseShiftC23_) * kfBasex2_ * kfBasex3_; kfBaseC33_ = pow(2, kfBaseShiftC33_) * kfBasex3_ * kfBasex3_; } - + // returns bit accurate position of a stub from a given tfp identifier region [0-8] channel [0-47] GlobalPoint Setup::stubPos(bool hybrid, const TTDTC::Frame& frame, int tfpRegion, int tfpChannel) const { GlobalPoint p; @@ -628,7 +628,7 @@ namespace trackerDTC { const bool barrel = detId.subdetId() == StripSubdetector::TOB; const bool psModule = Setup::psModule(dtcId); const int layerId = - (barrel ? trackerTopology_->layer(detId) : trackerTopology_->tidWheel(detId)) - offsetLayerId_; + (barrel ? trackerTopology_->layer(detId) : trackerTopology_->tidWheel(detId)) - offsetLayerId_; const bool side = Setup::side(dtcId); SensorModule::Type type; if (barrel && psModule) @@ -679,18 +679,18 @@ namespace trackerDTC { } return p; } - + // returns global TTStub position GlobalPoint Setup::stubPos(const TTStubRef& ttStubRef) const { const DetId detId = ttStubRef->getDetId() + offsetDetIdDSV_; const GeomDetUnit* det = trackerGeometry_->idToDetUnit(detId); const PixelTopology* topol = - dynamic_cast(&(dynamic_cast(det)->specificTopology())); + dynamic_cast(&(dynamic_cast(det)->specificTopology())); const Plane& plane = dynamic_cast(det)->surface(); const MeasurementPoint& mp = ttStubRef->clusterRef(0)->findAverageLocalCoordinatesCentered(); return plane.toGlobal(topol->localPosition(mp)); } - + // range check of dtc id void Setup::checkDTCId(int dtcId) const { if (dtcId < 0 || dtcId >= numDTCsPerRegion_ * numRegions_) { @@ -701,7 +701,7 @@ namespace trackerDTC { throw exception; } } - + // range check of tklayout id void Setup::checkTKLayoutId(int tkLayoutId) const { if (tkLayoutId <= 0 || tkLayoutId > numDTCsPerRegion_ * numRegions_) { @@ -712,7 +712,7 @@ namespace trackerDTC { throw exception; } } - + // range check of tfp identifier void Setup::checkTFPIdentifier(int tfpRegion, int tfpChannel) const { const bool oorRegion = tfpRegion >= numRegions_ || tfpRegion < 0; @@ -731,5 +731,5 @@ namespace trackerDTC { throw exception; } } - + } // namespace trackerDTC