Skip to content

Commit 37cabeb

Browse files
committed
Changes to implement sector based mode 7 promotion in EMTF for Run 3 2025
1 parent a15ec32 commit 37cabeb

File tree

7 files changed

+29
-6
lines changed

7 files changed

+29
-6
lines changed

L1Trigger/L1TMuonEndCap/interface/PtAssignment.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class PtAssignment {
2323
bool bugGMTPhi,
2424
bool promoteMode7,
2525
int modeQualVer,
26+
std::vector<int> promoteMode7Sectors,
2627
std::string pbFileName);
2728

2829
void process(EMTFTrackCollection& best_tracks);
@@ -38,6 +39,7 @@ class PtAssignment {
3839

3940
bool bugGMTPhi_, promoteMode7_;
4041
int modeQualVer_;
42+
std::vector<int> promoteMode7Sectors_;
4143
};
4244

4345
#endif

L1Trigger/L1TMuonEndCap/interface/VersionControl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class VersionControl {
5757
bool readPtLUTFile_, fixMode15HighPt_;
5858
bool bug9BitDPhi_, bugMode7CLCT_, bugNegPt_, bugGMTPhi_, promoteMode7_;
5959
int modeQualVer_;
60+
std::vector<int> promoteMode7Sectors_; // Sectors to promote mode 7 tracks in Run 2 and Run 3, -1 for all sectors
6061
std::string pbFileName_;
6162
};
6263

L1Trigger/L1TMuonEndCap/python/simEmtfDigis_cfi.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
BugGMTPhi = cms.bool(False), # Some drift in uGMT phi conversion, off by up to a few degrees
126126
PromoteMode7 = cms.bool(False), # Assign station 2-3-4 tracks with |eta| > 1.6 SingleMu quality
127127
ModeQualVer = cms.int32(2), # Version 2 contains modified mode-quality mapping for 2018
128-
128+
PromoteMode7Sectors = cms.vint32(-1), # Sectors to promote mode 7 tracks in Run 2 and Run 3, -1 for all sectors
129129
ProtobufFileName = cms.string('model_graph.displ.16.pb'), # Protobuf file name to be used by NN based pT assignment NNv16 is online since 26.06.2023
130130
),
131131

@@ -165,3 +165,7 @@
165165
## Era: Run3_2021
166166
from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021
167167
stage2L1Trigger_2021.toModify(simEmtfDigis, RPCEnable = True, UseRun3CCLUT_OTMB = True, Era = 'Run3_2021')
168+
169+
## Era: Run3_2025
170+
from Configuration.Eras.Modifier_stage2L1Trigger_2025_cff import stage2L1Trigger_2025
171+
stage2L1Trigger_2025.toModify(simEmtfDigis, RPCEnable = True, UseRun3CCLUT_OTMB = True, spPAParams16 = dict(PromoteMode7Sectors = {+3, +4}), Era = 'Run3_2025')

L1Trigger/L1TMuonEndCap/src/EMTFSetup.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ EMTFSetup::EMTFSetup(const edm::ParameterSet& iConfig, edm::ConsumesCollector iC
2121
// Set pt assignment engine according to Era
2222
if (era() == "Run2_2016") {
2323
pt_assign_engine_ = std::make_unique<PtAssignmentEngine2016>();
24-
} else if (era() == "Run2_2017" || era() == "Run2_2018") {
24+
} else if (era() == "Run2_2017" || era() == "Run2_2018" || era() == "Run3_2021" || era() == "Run3_2023" ||
25+
era() == "Run3_2024" || era() == "Run3_2025") {
2526
pt_assign_engine_ = std::make_unique<PtAssignmentEngine2017>();
26-
} else if (era() == "Run3_2021") {
27-
pt_assign_engine_ = std::make_unique<PtAssignmentEngine2017>(); //TODO - implement ver 2021
2827
} else {
2928
throw cms::Exception("L1TMuonEndCap") << "Cannot recognize the era option: " << era();
3029
}

L1Trigger/L1TMuonEndCap/src/PtAssignment.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ void PtAssignment::configure(PtAssignmentEngine* pt_assign_engine,
1717
bool bugGMTPhi,
1818
bool promoteMode7,
1919
int modeQualVer,
20+
std::vector<int> promoteMode7Sectors,
2021
std::string pbFileName) {
2122
emtf_assert(pt_assign_engine != nullptr);
2223
emtf_assert(pt_assign_engine_dxy != nullptr);
@@ -37,6 +38,17 @@ void PtAssignment::configure(PtAssignmentEngine* pt_assign_engine,
3738
bugGMTPhi_ = bugGMTPhi;
3839
promoteMode7_ = promoteMode7;
3940
modeQualVer_ = modeQualVer;
41+
promoteMode7Sectors_ = promoteMode7Sectors;
42+
43+
int es = endcap_ == 1 ? sector_ : -1 * sector_; // Endcap sign and sector number
44+
45+
if (promoteMode7_ &&
46+
(promoteMode7Sectors_.at(0) == -1 ||
47+
std::find(promoteMode7Sectors_.begin(), promoteMode7Sectors_.end(), es) != promoteMode7Sectors_.end())) {
48+
promoteMode7_ = true; // Assign station 2-3-4 tracks with |eta| > 1.6 SingleMu quality in a given sector
49+
} else {
50+
promoteMode7_ = false; // Do not promote mode 7 tracks of other sectors
51+
}
4052
}
4153

4254
void PtAssignment::process(EMTFTrackCollection& best_tracks) {

L1Trigger/L1TMuonEndCap/src/SectorProcessor.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ void SectorProcessor::process_single_bx(int bx,
168168
cfg.bugGMTPhi_,
169169
cfg.promoteMode7_,
170170
cfg.modeQualVer_,
171+
cfg.promoteMode7Sectors_,
171172
cfg.pbFileName_);
172173

173174
std::map<int, TriggerPrimitiveCollection> selected_dt_map;

L1Trigger/L1TMuonEndCap/src/VersionControl.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ VersionControl::VersionControl(const edm::ParameterSet& iConfig) : config_(iConf
6363
bugGMTPhi_ = spPAParams16.getParameter<bool>("BugGMTPhi");
6464
promoteMode7_ = spPAParams16.getParameter<bool>("PromoteMode7");
6565
modeQualVer_ = spPAParams16.getParameter<int>("ModeQualVer");
66+
promoteMode7Sectors_ = spPAParams16.getParameter<std::vector<int> >("PromoteMode7Sectors");
6667
pbFileName_ = spPAParams16.getParameter<std::string>("ProtobufFileName");
6768
}
6869

@@ -76,7 +77,6 @@ void VersionControl::configure_by_fw_version(unsigned fw_version) {
7677
// For now, no switches later than FW version 47864 (end-of-year 2016)
7778
// Beggining in late 2016, "fw_version" in O2O populated with timestamp, rather than FW version
7879
// tm fw_time = gmtime(fw_version); (See https://linux.die.net/man/3/gmtime, https://www.epochconverter.com)
79-
8080
/////////////////////////////////////////////////////////////////////////////////
8181
/// Settings for 2018 (by default just use settings in simEmtfDigis_cfi.py) ///
8282
/////////////////////////////////////////////////////////////////////////////////
@@ -120,7 +120,6 @@ void VersionControl::configure_by_fw_version(unsigned fw_version) {
120120
// ---------------------------------------------------------------------------------
121121
modeQualVer_ = 2; // Version 2 contains modified mode-quality mapping for 2018
122122
promoteMode7_ = false; // Assign station 2-3-4 tracks with |eta| > 1.6 SingleMu quality
123-
124123
// ___________________________________________________________________________
125124
// Versions in 2018 - no external documentation
126125
// As of the beginning of 2018 EMTF O2O was broken, not updating the database with online conditions
@@ -134,6 +133,11 @@ void VersionControl::configure_by_fw_version(unsigned fw_version) {
134133
promoteMode7_ = true; // Assign station 2-3-4 tracks with |eta| > 1.6 SingleMu quality
135134
}
136135

136+
// Promote Mode 7 settings for 2025. Implemented here since all the rest of the settings are the same as in 2018.
137+
if (fw_version >= 1747996116) { // May 23, 2025
138+
promoteMode7_ = true; // Assign station 2-3-4 tracks with |eta| > 1.6 SingleMu quality
139+
}
140+
137141
return;
138142
}
139143

0 commit comments

Comments
 (0)