Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
77c76bd
First inclusion of 2024 (skimming and looper updates)
JavierGarciadeCastro Apr 7, 2026
09017e8
Skimming working locally with 2024 AODSIM samples
Apr 10, 2026
847bd49
Remove unnecessary debugging
Apr 10, 2026
a120bc8
OR of Vtx and NoVtx paths for 2024, and conditioning options
Apr 13, 2026
06efb3f
Solve conflicts
Apr 13, 2026
35d386b
Activate filters for background, but not for signal (process them sep…
Apr 15, 2026
848b79e
Adapt code to MiniAOD
Apr 21, 2026
f1947c2
Addition of Vtx collection vertices to skimmer
CeliaFernandez Apr 22, 2026
91bbb86
Looper with lxplus, have to run with uaf
May 8, 2026
b1427b6
Condor looper for 2024 in uaf (need singularity)
JavierGarciadeCastro May 12, 2026
c73b9be
Working condor looper for 2024
JavierGarciadeCastro May 13, 2026
9a225de
BDT training with looper variables
JavierGarciadeCastro May 19, 2026
6983db3
Improve BDT curves and plots
JavierGarciadeCastro May 20, 2026
20145bc
Apply material veto as preselection
JavierGarciadeCastro May 21, 2026
9a198de
Correct preselection and cut and count, and add angular variables
JavierGarciadeCastro May 26, 2026
fe0c329
Include conditions for 2024 data processing
CeliaFernandez May 27, 2026
086ac20
Fix: revert trigger treatment to original one
CeliaFernandez May 27, 2026
04cb1ba
Structured looper: First NoVtx and if 2024 Vtx collection
Jun 1, 2026
22fa6c9
Full comparison with parking
JavierGarciadeCastro Jun 11, 2026
8b3080e
Add bkg weighting and processing of minBias sample in skimmer
JavierGarciadeCastro Jun 16, 2026
eebab37
condor setuo for the BDT
JavierGarciadeCastro Jun 30, 2026
ea2df72
Correct condor setup for the BDT
JavierGarciadeCastro Jun 30, 2026
a094818
MinBias bkg processing and code cleanup
JavierGarciadeCastro Jul 1, 2026
0b126fe
Process minbias and data (2024E) and add L1 info in tuples
JavierGarciadeCastro Jul 16, 2026
bb71100
Working version of the skimmer (to run with lxplus), and skim minbias
Jul 21, 2026
cf119db
Add muon and SV count to looper and filler
JavierGarciadeCastro Jul 22, 2026
3f3fff5
Skip bad input files in looper and improve README
JavierGarciadeCastro Jul 24, 2026
61084ea
Fix typo in README
JavierGarciadeCastro Jul 24, 2026
4a3f4da
Re-Fix typo in README
JavierGarciadeCastro Jul 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions batch/Scouting/NtupleMaker/plugins/TriggerMaker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ void TriggerMaker::produce(edm::Event& iEvent, const edm::EventSetup& iSetup){
for(unsigned int i = 0; i < nTriggers; ++i){
const string& name = triggerNames_.triggerName(i);
//should check this part further
if (name.find("DST_Run3_PFScoutingPixelTracking") != std::string::npos || name.find("DST_Run3_DoubleMu3_PFScoutingPixelTracking") != std::string::npos) {
if (name.find("DST_Run3_PFScoutingPixelTracking") != std::string::npos || name.find("DST_Run3_DoubleMu3_PFScoutingPixelTracking") != std::string::npos || name.find("DST_PFScouting_DoubleMuon") != std::string::npos) {
itrig = i;
break;
}
}
if (itrig < 0) {
throw cms::Exception("TriggerMaker::produce: Couldn't find DST_Run3_PFScoutingPixelTracking or DST_Run3_DoubleMu3_PFScoutingPixelTracking in the list of triggers");
throw cms::Exception("TriggerMaker::produce: Couldn't find DST_Run3_PFScoutingPixelTracking or DST_Run3_DoubleMu3_PFScoutingPixelTracking or DST_PFScouting_DoubleMuon in the list of triggers");
}

pat::TriggerObjectStandAlone TO;
Expand Down
103 changes: 81 additions & 22 deletions batch/Scouting/NtupleMaker/test/producer_Run3.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def convert_fname(fname):
else:
#gtag="124X_mcRun3_2022_realistic_postEE_v1"
gtag="130X_mcRun3_2022_realistic_postEE_v6" # Found for central production
elif '2024' in opts.era:
gtag="140X_mcRun3_2024_realistic_v26" # Found for central production (RunIII2024Summer24DRPremix)
else:
#gtag="130X_mcRun3_2023_realistic_v9" # latest MC GT (=phase1_2023_realistic, in CMSSW_13_1_0)
if not 'BPix' in opts.era:
Expand All @@ -70,7 +72,11 @@ def convert_fname(fname):

process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(opts.nevents))

process.options = cms.untracked.PSet(SkipEvent = cms.untracked.vstring('ProductNotFound'))
if '2024' in opts.era or '2025' in opts.era:
process.options = cms.untracked.PSet(TryToContinue = cms.untracked.vstring('ProductNotFound'))
else:
process.options = cms.untracked.PSet(SkipEvent = cms.untracked.vstring('ProductNotFound'))


if opts.data:
process.MessageLogger.cerr.FwkReport.reportEvery = 1000
Expand All @@ -94,21 +100,29 @@ def convert_fname(fname):
# skim data, but keep all events for MC acceptance calculations
do_skim = opts.data

# Build output keep commands based on era (2024+ uses Vtx/NoVtx split collections)
if '2024' in opts.era or '2025' in opts.era:
out_keep_muon = ["keep *_hltScoutingMuonPackerVtx_*_*", "keep *_hltScoutingMuonPackerNoVtx_*_*"]
out_keep_hit = ["keep *_hitMakerVtx_*_*", "keep *_hitMakerNoVtx_*_*"]
else:
out_keep_muon = ["keep *_hltScoutingMuonPacker_*_*"]
out_keep_hit = ["keep *_hitMaker_*_*"]

process.out = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('file:output.root'),
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('skimpath'),
),
outputCommands = cms.untracked.vstring(
"drop *",
"keep *_hltScoutingMuonPacker_*_*",
["drop *"] + out_keep_muon + [
"keep *_hltScoutingPFPacker_*_*",
"keep *_hltScoutingPrimaryVertexPacker_*_*",
"keep *_triggerMaker_*_*",
"keep *_hitMaker_*_*",
] + out_keep_hit + [
"keep *_beamSpotMaker_*_*",
"keep *_genParticles_*_HLT",
),
"keep *_addPileupInfo_*_*",
]),
basketSize = cms.untracked.int32(128*1024), # 128kb basket size instead of ~30kb default
)

Expand All @@ -121,15 +135,28 @@ def convert_fname(fname):
summaryOnly = cms.untracked.bool(True)
)

process.countmu = cms.EDFilter("ScoutingMuonCountFilter",
src = cms.InputTag("hltScoutingMuonPacker"),
minNumber = cms.uint32(2)
)

process.countvtx = cms.EDFilter("ScoutingVertexCountFilter",
src = cms.InputTag("hltScoutingMuonPacker","displacedVtx"),
minNumber = cms.uint32(1)
)
if '2024' in opts.era or '2025' in opts.era:
process.countmuVtx = cms.EDFilter("ScoutingMuonCountFilter",
src = cms.InputTag("hltScoutingMuonPackerVtx"),
minNumber = cms.uint32(2)
)
process.countmuNoVtx = cms.EDFilter("ScoutingMuonCountFilter",
src = cms.InputTag("hltScoutingMuonPackerNoVtx"),
minNumber = cms.uint32(2)
)
process.countvtxNoVtx = cms.EDFilter("ScoutingVertexCountFilter",
src = cms.InputTag("hltScoutingMuonPackerNoVtx","displacedVtx"),
minNumber = cms.uint32(1)
)
else:
process.countmu = cms.EDFilter("ScoutingMuonCountFilter",
src = cms.InputTag("hltScoutingMuonPacker"),
minNumber = cms.uint32(2)
)
process.countvtx = cms.EDFilter("ScoutingVertexCountFilter",
src = cms.InputTag("hltScoutingMuonPacker","displacedVtx"),
minNumber = cms.uint32(1)
)

# To recover trigger info: https://hlt-config-editor-confdbv3.app.cern.ch/ + https://twiki.cern.ch/twiki/bin/viewauth/CMS/PdmVRun3Analysis + https://cmsoms.cern.ch/cms/triggers/report?cms_run=<run>
L1Info = []
Expand Down Expand Up @@ -172,6 +199,19 @@ def convert_fname(fname):
"L1_SingleEG34er2p5", "L1_SingleEG36er2p5", "L1_SingleEG38er2p5", "L1_SingleEG40er2p5", "L1_SingleJet160er2p5", "L1_SingleJet180", "L1_SingleJet200", "L1_SingleTau120er2p1", "L1_SingleTau130er2p1", "L1_SingleEG42er2p5", "L1_SingleEG45er2p5", "L1_SingleEG60"
]
L1Info = list(set(L1Info))
elif '2024' in opts.era or '2025' in opts.era:
# 2024+: unprescaled DoubleMuon (no PixelTracking in path name) + SingleMuon L1/HLT seeds
L1Info = [
"L1_DoubleMu_12_5","L1_DoubleMu_15_7",
"L1_DoubleMu4p5er2p0_SQ_OS_Mass_Min7","L1_DoubleMu4p5er2p0_SQ_OS_Mass_7to18",
"L1_DoubleMu4_SQ_OS_dR_Max1p2","L1_DoubleMu4p5_SQ_OS_dR_Max1p2",
"L1_DoubleMu0er1p4_SQ_OS_dR_Max1p4","L1_DoubleMu0er1p5_SQ_OS_dR_Max1p4","L1_DoubleMu8_SQ",
"L1_SingleMu22","L1_SingleMu25",
]
HLTInfo = [
[ 'Run3_DoubleMu_PFScouting', 'DST_PFScouting_DoubleMuon_v*' ],
[ 'Run3_SingleMu_PFScouting', 'DST_PFScouting_SingleMuon_v*' ],
]
else:
# for run >=367621 (during era Run2023C)
L1Info = ["L1_DoubleMu_12_5","L1_DoubleMu_15_7","L1_DoubleMu4p5er2p0_SQ_OS_Mass_Min7","L1_DoubleMu4p5er2p0_SQ_OS_Mass_7to18","L1_DoubleMu4_SQ_OS_dR_Max1p2","L1_DoubleMu4p5_SQ_OS_dR_Max1p2","L1_DoubleMu0er1p4_SQ_OS_dR_Max1p4","L1_DoubleMu0er1p5_SQ_OS_dR_Max1p4","L1_DoubleMu8_SQ"]
Expand Down Expand Up @@ -244,11 +284,23 @@ def convert_fname(fname):
l1Seeds = cms.vstring(L1Info),
)

process.hitMaker = cms.EDProducer("HitMaker",
muonInputTag = cms.InputTag("hltScoutingMuonPacker"),
dvInputTag = cms.InputTag("hltScoutingMuonPacker:displacedVtx"),
measurementTrackerEventInputTag = cms.InputTag("MeasurementTrackerEvent"),
)
if '2024' in opts.era or '2025' in opts.era:
process.hitMakerVtx = cms.EDProducer("HitMaker",
muonInputTag = cms.InputTag("hltScoutingMuonPackerVtx"),
dvInputTag = cms.InputTag("hltScoutingMuonPackerVtx:displacedVtx"),
measurementTrackerEventInputTag = cms.InputTag("MeasurementTrackerEvent"),
)
process.hitMakerNoVtx = cms.EDProducer("HitMaker",
muonInputTag = cms.InputTag("hltScoutingMuonPackerNoVtx"),
dvInputTag = cms.InputTag("hltScoutingMuonPackerNoVtx:displacedVtx"),
measurementTrackerEventInputTag = cms.InputTag("MeasurementTrackerEvent"),
)
else:
process.hitMaker = cms.EDProducer("HitMaker",
muonInputTag = cms.InputTag("hltScoutingMuonPacker"),
dvInputTag = cms.InputTag("hltScoutingMuonPacker:displacedVtx"),
measurementTrackerEventInputTag = cms.InputTag("MeasurementTrackerEvent"),
)

process.beamSpotMaker = cms.EDProducer("BeamSpotMaker")

Expand All @@ -268,6 +320,13 @@ def convert_fname(fname):
#process.patTrigger.triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT")
process.patTrigger.stageL1Trigger = cms.uint32(2)

#hitMaker not needed (Mario)
if (opts.data): process.skimpath = cms.Path(process.countmu+process.countvtx+process.gtStage2Digis+process.triggerMaker+process.offlineBeamSpot+process.beamSpotMaker+process.MeasurementTrackerEvent+process.hitMaker)
else: process.skimpath = cms.Path(process.gtStage2Digis+process.patTrigger+process.triggerMaker+process.offlineBeamSpot+process.beamSpotMaker+process.MeasurementTrackerEvent+process.hitMaker)
if '2024' in opts.era or '2025' in opts.era:
if (opts.data):
process.skimpath_vtx = cms.Path(process.countmuVtx+process.gtStage2Digis+process.triggerMaker+process.offlineBeamSpot+process.beamSpotMaker+process.MeasurementTrackerEvent+process.hitMakerVtx+process.hitMakerNoVtx)
process.skimpath_novtx = cms.Path(process.countmuNoVtx+process.countvtxNoVtx+process.gtStage2Digis+process.triggerMaker+process.offlineBeamSpot+process.beamSpotMaker+process.MeasurementTrackerEvent+process.hitMakerVtx+process.hitMakerNoVtx)
process.out.SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring('skimpath_vtx', 'skimpath_novtx'))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I believe this should be working as expected, OR of the 2 paths, where we require NoVtx collection to have >= 2 muons and >=1 vertex and the Vtx collection to have >=2 muons

else: process.skimpath = cms.Path(process.gtStage2Digis+process.patTrigger+process.triggerMaker+process.offlineBeamSpot+process.beamSpotMaker+process.MeasurementTrackerEvent+process.hitMakerVtx+process.hitMakerNoVtx)
else:
#hitMaker not needed (Mario)
if (opts.data): process.skimpath = cms.Path(process.countmu+process.countvtx+process.gtStage2Digis+process.triggerMaker+process.offlineBeamSpot+process.beamSpotMaker+process.MeasurementTrackerEvent+process.hitMaker)
else: process.skimpath = cms.Path(process.gtStage2Digis+process.patTrigger+process.triggerMaker+process.offlineBeamSpot+process.beamSpotMaker+process.MeasurementTrackerEvent+process.hitMaker)
43 changes: 30 additions & 13 deletions batch/crabcfg_run3_centralmc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from CRABClient.UserUtilities import config #, getUsernameFromSiteDB
from CRABAPI.RawCommand import crabCommand
from CRABAPI.RawCommand import crabCommand4
from http.client import HTTPException
from CRABClient.ClientExceptions import ClientException

# https://twiki.cern.ch/twiki/bin/view/CMSPublic/CRAB3ConfigurationFile
#config = config()
Expand All @@ -15,14 +17,16 @@
year=2022
elif ("2023") in era:
year=2023
elif ("2024") in era:
year=2024
else:
quit()

# This is only MC, should not be used to run on data
data=False

# ntuple version defined now
ntuple_version = "_hahm_6p2"
ntuple_version = "_dqcd_2024"

# Setup working environment
import os
Expand Down Expand Up @@ -252,30 +256,43 @@
config_list[-1].Data.inputDataset = dataset_name
config_list[-1].General.requestName = 'centralSkim__{}_{}_m-{}_ctau-{}mm_{}'.format(signal, era, m, t, ntuple_version)
print(config)
crabCommand('submit', config = config, dryrun = False) ## dryrun = True for local test
crabCommand('submit', config = config, dryrun = False)
elif "DQCD" in sys.argv[2]:
config.Data.outLFNDirBase = '/store/group/Run3Scouting/RAWScouting_privQCD_v'+ntuple_version # DB no
config.Data.inputDBS = 'phys03'
config.Data.splitting = 'FileBased'
#config.Data.inputDBS = 'phys03'
config.Data.inputDBS = 'global'
#config.Data.splitting = 'FileBased'
config.Data.splitting = 'EventAwareLumiBased'
config.Data.unitsPerJob = int(10e4)
config.Data.publication = True
config.Data.unitsPerJob = int(10) # Increased to match 10 jobs per file aprox
config.Data.outputDatasetTag = "private-Skim_{era}-v2".format(era=era)
if era=="2022":
inputfile = 'data/datasets_dqcd_2022.txt'
if era=="2022postEE":
inputfile = 'data/datasets_dqcd_2022postEE.txt'
if era=="2024":
inputfile = 'data/datasets_dqcd_2024.txt'
with open(inputfile,'r') as f:
dataset_list = f.readlines()
for dataset_name in dataset_list:
config_list.append(config)
config_list[-1].JobType.pyCfgParams=["era={}".format(era),"data=False",]
print(dataset_name)
config_list[-1].Data.inputDataset = dataset_name[:-1]
model_name = 'S'+dataset_name.split('_')[0][2:]
mpi = dataset_name.split('mpi_')[1].split('_')[0]
mA = dataset_name.split('mA_')[1].split('_')[0]
t = dataset_name.split('ctau_')[1].split('/')[0]
config_list[-1].General.requestName = 'centralSkim__{}_{}_mpi-{}_mA-{}_ctau-{}mm_{}'.format(model_name, era, mpi, mA, t, ntuple_version)
#config_list[-1].Data.inputDataset = dataset_name[:-1]
config_list[-1].Data.inputDataset = dataset_name.strip()
if era == "2024":
model_name = dataset_name.split('-')[1]
t = dataset_name.split('ctau-')[1].split('-')[0]
mA = dataset_name.split('mA-')[1].split('-')[0]
mpi = dataset_name.split('mpi-')[1].split('_')[0]
else:
model_name = 'S'+dataset_name.split('_')[0][2:]
mpi = dataset_name.split('mpi_')[1].split('_')[0]
mA = dataset_name.split('mA_')[1].split('_')[0]
t = dataset_name.split('ctau_')[1].split('/')[0]
config_list[-1].General.requestName = 'centralSkim__{}_{}_mpi-{}_mA-{}_ctau-{}mm{}'.format(model_name, era, mpi, mA, t, ntuple_version)
config_list[-1].Data.inputDataset = dataset_name.strip()

print(config)
try:
crabCommand('submit', config = config, dryrun = False) ## dryrun = True for local test
Expand Down Expand Up @@ -384,7 +401,7 @@
# No 2023 eras for the moment, when adding them, you have to run . install_cmssw.sh 2023central first
config_list[-1].General.requestName = 'centralSkim__{}_{}_mpi-{}_mA-{}_ctau-{}mm_{}'.format(signal, era, mpi, mA, t, ntuple_version)
print(config)
crabCommand('submit', config = config, dryrun = False) ## dryrun = True for local test
crabCommand('submit', config = config, dryrun = True) ## dryrun = True for local test
elif "ScenarioB1" in sys.argv[2]:
config.Data.outLFNDirBase = '/store/group/Run3Scouting/RAWScouting_privScenarioA_v'+ntuple_version # DB no
config.Data.inputDBS = 'phys03'
Expand Down
Loading