Skip to content

Commit

Permalink
Fix to include the possibility to read the OS requirement for TripleM…
Browse files Browse the repository at this point in the history
…u seeds with the three-muon invariant mass requirement (final)
  • Loading branch information
elfontan committed Nov 17, 2022
1 parent 0d22922 commit 3f952d5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 31 deletions.
15 changes: 8 additions & 7 deletions L1Trigger/L1TGlobal/src/CorrThreeBodyCondition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ const bool l1t::CorrThreeBodyCondition::evaluateCondition(const int bxEval) cons
// SECOND OBJECT: Now loop over the second leg to get its information
for (std::vector<SingleCombInCond>::const_iterator it1Comb = cond1Comb.begin(); it1Comb != cond1Comb.end();
it1Comb++) {
LogDebug("L1TGlobal") << "Looking at second subdondition" << std::endl;
LogDebug("L1TGlobal") << "Looking at second subcondition" << std::endl;
int obj1Index = -1;

if (!(*it1Comb).empty()) {
Expand Down Expand Up @@ -471,20 +471,21 @@ const bool l1t::CorrThreeBodyCondition::evaluateCondition(const int bxEval) cons
// Now perform the desired correlation on these three objects:
// reqResult will be set true in case all checks were successful for a given combination of three muons
bool reqResult = false;

// Check the three-muon charge correlation, if requested
bool chrgCorrel = true;

// Check the three-muon charge correlation, if requested.
// NOTE that the charge can be 1 (positive) or 0 (negative), so [SS] SUM(chrg) == 3 OR 0, [OS] SUM(chrg) == 1 OR 2
if (cond0Categ == CondMuon && cond1Categ == CondMuon && cond2Categ == CondMuon) {
// Check for opp-sign
if (corrPar.chargeCorrelation == 4 && fabs(chrg0 + chrg1 + chrg2) == 3) {
// Check for opp-sign requirement:
if (corrPar.chargeCorrelation == 4 && ((chrg0 + chrg1 + chrg2) == 3 || (chrg0 + chrg1 + chrg2) == 0)) {
chrgCorrel = false;
}
// Check for same-sign
else if (corrPar.chargeCorrelation == 2 && fabs(chrg0 + chrg1 + chrg2) != 3) {
if (corrPar.chargeCorrelation == 2 && ((chrg0 + chrg1 + chrg2) == 1 || (chrg0 + chrg1 + chrg2) == 2)) {
chrgCorrel = false;
}
// Ignore the charge correlation requirement
else if (corrPar.chargeCorrelation == 1) {
if (corrPar.chargeCorrelation == 1) {
chrgCorrel = true;
}
}
Expand Down
60 changes: 36 additions & 24 deletions L1Trigger/L1TGlobal/test/testVectorCode_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
skip = skip-4
neventsPerJob = neventsPerJob+4


# ------------------------------------------------------------
# Set up Run 3 conditions to get the proper emulation sequence
# ------------------------------------------------------------
Expand All @@ -55,8 +54,9 @@
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff')


# Select the Message Logger output you would like to see:
# ---------------------
# Message Logger output
# ---------------------
process.load('FWCore.MessageService.MessageLogger_cfi')
#process.load('L1Trigger/L1TYellow/l1t_debug_messages_cfi')
#process.load('L1Trigger/L1TYellow/l1t_info_messages_cfi')
Expand All @@ -65,18 +65,20 @@
process.MessageLogger.l1t_debug.l1t.limit = cms.untracked.int32(100000)

process.MessageLogger.categories.append('l1t|Global')

# DEBUG
#process.MessageLogger.debugModules = cms.untracked.vstring('simGtStage2Digis')
#process.MessageLogger.cerr.threshold = cms.untracked.string('DEBUG')

# ------------
# Input source
# ------------
# Set the number of events
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(neventsPerJob)
)

# ------------
# Input source
# ------------
# Set file: it needs to be a RAW format
process.source = cms.Source("PoolSource",
secondaryFileNames = cms.untracked.vstring(),
fileNames = cms.untracked.vstring(
Expand Down Expand Up @@ -111,8 +113,7 @@
# ----------------
process.load('L1Trigger.L1TGlobal.GlobalParameters_cff')
process.load("L1Trigger.L1TGlobal.TriggerMenu_cff")
xmlMenu="L1Menu_Collisions2022_v1_3_0_TripleMuOS.xml"
#xmlMenu="L1Menu_TripleMu_test_TripleMuOS_v2.xml"
xmlMenu="L1Menu_Collisions2022_v1_3_0.xml"
process.TriggerMenu.L1TriggerMenuFile = cms.string(xmlMenu)
process.ESPreferL1TXML = cms.ESPrefer("L1TUtmTriggerMenuESProducer","TriggerMenu")

Expand Down Expand Up @@ -196,7 +197,9 @@

process.MessageLogger.categories.append("MuConditon")

# -------------------------
# Setup Digi to Raw to Digi
# -------------------------
process.load('EventFilter.L1TRawToDigi.gtStage2Raw_cfi')
process.gtStage2Raw.GtInputTag = cms.InputTag("simGtStage2Digis")
process.gtStage2Raw.ExtInputTag = cms.InputTag("simGtExtFakeProd")
Expand Down Expand Up @@ -243,7 +246,9 @@
psColumn = cms.int32(1)
)

# gt analyzer
# -----------
# GT analyzer
# -----------
process.l1tGlobalAnalyzer = cms.EDAnalyzer('L1TGlobalAnalyzer',
doText = cms.untracked.bool(False),
gmuToken = cms.InputTag("None"),
Expand All @@ -261,39 +266,46 @@
emulGtAlgToken = cms.InputTag("simGtStage2Digis")
)

# ------------------
# Process definition
# ------------------
process.p1 = cms.Path(
## Generate input, emulate, dump results
## Input, emulation, dump of the results
process.dumpMenu
*process.RawToDigi
# *process.gtInput
# *process.dumpGT
#*process.gtInput
#*process.dumpGT
*process.simGtExtFakeProd
*process.simGtStage2Digis
*process.dumpGTRecord

## Sequence for packing and unpacking uGT data
# +process.gtStage2Raw
# +process.dumpRaw
# +process.newGtStage2Digis
# +process.newDumpGTRecord
## Sequence for packing and unpacking uGT data
#+process.gtStage2Raw
#+process.dumpRaw
#+process.newGtStage2Digis
#+process.newDumpGTRecord

## Analysis/Dumping
## Analysis/Dumping
*process.l1tGlobalAnalyzer
# *process.menuDumper # DEBUG -> to activate the menuDumper
# *process.debug
# *process.dumpED
# *process.dumpES
#*process.menuDumper # DEBUG -> to activate the menuDumper
#*process.debug
#*process.dumpED
#*process.dumpES
)

# -------------------
# Schedule definition
# -------------------
process.schedule = cms.Schedule(
process.p1
)
)
#process.schedule.append(process.report)

if rootout:
process.outpath = cms.EndPath(process.output)
process.schedule.append(process.outpath)

# Spit out filter efficiency at the end.
# Spit out filter efficiency at the end
process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(True))

# Options for multithreading
Expand Down

0 comments on commit 3f952d5

Please sign in to comment.