Skip to content

Updating DT Calibration workflows for CMSSW_15_0_4 #47869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 79 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
327a785
add filter to skip events without scouting objects and introduce @Sco…
patinkaew Mar 27, 2025
c5b140f
update relval to use @Prompt+@ScoutMonitor
patinkaew Mar 27, 2025
a1ab457
backporting to 150X
michael-pitt Apr 2, 2025
d428c9f
fix read rules
AuroraPerego Mar 25, 2025
ef4d75f
config file for CP from PU
AuroraPerego Nov 13, 2024
68b67de
add procModifier to enable caloparticles from pileup
AuroraPerego Mar 25, 2025
e6cb5ed
set crossedBoundary_ only for classVersion 12
AuroraPerego Apr 2, 2025
5e32749
Add ECAL CC timing modifier to Run3_2025 era.
thomreis Apr 3, 2025
32607a6
Make ReserveDMu skim throw exception upon mismatch in requested trigg…
Apr 8, 2025
9e6ef57
Update comment in PDWG_ReserveDMu_SD_cff.py
LinaresToine Apr 8, 2025
9e33138
Reduced excessive axes limits
AndreaBellora Apr 8, 2025
23e2931
Code-checks and formatting
AndreaBellora Apr 9, 2025
76cb941
Update DT calibration workflows to work with new CMSSW release
andreypz Apr 9, 2025
f96c5a0
Applied coherent ranges also to efficiency maps
AndreaBellora Apr 9, 2025
48a9796
Add plugin to obtain an unique best track index for Run 3 Scouting El…
arsahasransu Mar 28, 2025
18414a3
Add a log message for opened URL
makortel Apr 9, 2025
0251a3d
Use FwkInfo level for source deactivation messages
makortel Apr 9, 2025
d2e7e0f
Add the Scouting Glo-ParT inference facility
yiyangzha Apr 12, 2025
c46efcb
fix unprescaledAlgoShortList for 2025 (removal L1_AXO_Nominal in favo…
mmusich Apr 13, 2025
71e07a4
change era to Run3_2025 in a selected online DQM clients
mmusich Apr 13, 2025
888c587
fix hltInfo
mmusich Apr 12, 2025
e61e561
add a unit test for hltInfo
mmusich Apr 13, 2025
37cb972
Make scripts work with CMSSW_15_0_4
andreypz Apr 15, 2025
79dad72
Fix the AlCaRecoTriggerBits/SecondaryDataset tag for the first IOVs i…
perrotta Apr 10, 2025
005293f
CALO-L2 calibrations and cons. ZS for first L1 menu 2025
Apr 15, 2025
a4a0177
introduce function to perform branchless 'and' operation
kpedro88 Apr 11, 2025
1b94c55
use branchless 'and' in KDTree
kpedro88 Apr 11, 2025
20dccd8
use branchless 'and' in tracker hit matching
kpedro88 Apr 11, 2025
45ed7ff
inline function
kpedro88 Apr 11, 2025
c2e05ac
Merge pull request #47862 from mmusich/fix_unprescaledAlgoShortList_f…
cmsbuild Apr 15, 2025
ab0dc11
Merge pull request #47861 from mmusich/fix_hltInfo_15_0_X
cmsbuild Apr 15, 2025
831ab67
Merge pull request #47865 from mmusich/mm_2025_era_L1Tclients_15_0_X
cmsbuild Apr 16, 2025
7302771
Better raw_input method
andreypz Apr 16, 2025
c562a2d
update UParTAK4_v2.onnx location
yiyangzha Apr 16, 2025
a583e00
fix minor typo
yiyangzha Apr 16, 2025
ad4bcb2
Merge pull request #47802 from thomreis/activate-ecal-cctiming-2025-150x
cmsbuild Apr 16, 2025
266a891
fix SiPixelClusterizerPreSplitting for siPixelDigiMorphing
mmusich Apr 13, 2025
23873de
no delay read when runing PAT by itself. suggested for NANO
vlimant Apr 17, 2025
f9c5cc4
update TkAl PCL metadata for 2025
francescobrivio Apr 17, 2025
028f421
add SiPixelDigiMorphing workflows to upgrade matrix
mmusich Apr 13, 2025
5f93b59
btvNano: store all PS weights
mseidel42 Apr 17, 2025
f5db5b8
disable delayed read when NANO is the first step
vlimant Apr 18, 2025
0421818
add DQMEventInfo instance to the sequence run at Tier0 too
mmusich Apr 18, 2025
e57ee06
add a trailing return
vlimant Apr 18, 2025
0210044
Migration of all tables to CMSSW_15_0_4 template and removal of custo…
mmusich Apr 8, 2025
871ede2
Add customization for the serial sync tracking sequence in the mkFit …
Apr 21, 2025
c1ae707
Introduce DQM instance to monitor scouting objects
jprendi Mar 27, 2025
7143388
HLT menu development for 15_0_X.
mmusich Apr 9, 2025
5eb7e3c
remove frozen menu 2024 v1.4 and introduce new frozen menu 2025 v1.0
mmusich Apr 22, 2025
8806554
update makeOnlineSpecial to current versions
mmusich Apr 10, 2025
ed4f78c
update hltPathOwners for GRun menu 2025 V1.0
mmusich Apr 9, 2025
d704203
removed jet MET DQM left overs
jprendi Apr 22, 2025
73dd787
Merge pull request #47871 from perrotta/fixAlCaRecoTriggerBitsSeconda…
cmsbuild Apr 22, 2025
80ffac5
Merge pull request #47816 from LinaresToine/15-0-X-ReserveDMu-Throw-E…
cmsbuild Apr 22, 2025
72f8a8f
Merge pull request #47915 from makortel/urlOpenMessage_150x
cmsbuild Apr 23, 2025
154da33
Merge pull request #47759 from michael-pitt/150x-ktsmear
cmsbuild Apr 23, 2025
5514c8d
Merge pull request #47905 from mseidel42/btvNano_allPSWeight_15_0
cmsbuild Apr 23, 2025
b50e58e
Merge pull request #47800 from patinkaew/scouting_nano_dev_filter_15_0_2
cmsbuild Apr 23, 2025
8ec3c54
Merge pull request #47900 from francescobrivio/alca-update_DMD_15_0_X
cmsbuild Apr 23, 2025
6410715
Merge pull request #47875 from kpedro88/BranchlessAnd_15_0
cmsbuild Apr 23, 2025
af4388f
Merge pull request #47771 from AuroraPerego/fixCPfromPU_15_0
cmsbuild Apr 23, 2025
d45e5e7
Merge pull request #47899 from vlimant/delay_read_for_MININANO_150X
cmsbuild Apr 23, 2025
6830541
Merge pull request #47923 from jprendi/ScoutingDQM_15_0_X
cmsbuild Apr 23, 2025
517a4f6
Merge pull request #47917 from elusian/1504_FixMkFitHLTCustomizer
cmsbuild Apr 23, 2025
1632558
Merge pull request #47826 from CTPPS/ab_15_0_3_patch1_2025_dqm
cmsbuild Apr 23, 2025
a7c32fc
Merge pull request #47836 from arsahasransu/asahasra_run3sctele_bestt…
cmsbuild Apr 23, 2025
e32c23c
Merge pull request #47908 from mmusich/mm_dev_cosmics_dqmInfoHLTMon_1…
cmsbuild Apr 23, 2025
2f8e77c
Merge pull request #47895 from mmusich/mm_dev_PixelDigiMorphing_wfs_1…
cmsbuild Apr 23, 2025
fecb586
Merge pull request #47853 from yiyangzha/CMSSW_15_0_X
cmsbuild Apr 23, 2025
d4997db
Merge pull request #47929 from cms-tsg-storm/HLTdevelopment150X
cmsbuild Apr 24, 2025
87e8371
Merge pull request #47874 from Pmeiring/150X_caloParams2025v02
cmsbuild Apr 24, 2025
3e76776
Update L1TCaloStage2ParamsESProducer.cc
asavincms Apr 26, 2025
001b97d
Merge pull request #47956 from asavincms/mydev
cmsbuild Apr 29, 2025
4339213
Make vdrift workflows work again
andreypz May 14, 2025
b0a8547
Clenup
andreypz May 14, 2025
b7b17fc
Merged dev-dt-calib-April2025 from repository andreypz with cms-merge…
andreypz May 14, 2025
3889ee3
Updated plotting style
andreypz May 16, 2025
7bc0ea9
Fine tune plotting scripts
andreypz May 16, 2025
384bd43
add .db.txt extention to dump function
andreypz May 16, 2025
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
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
import ROOT

def drawHisto(histo,title,ymin,ymax,option="HISTOP",draw=True):
def drawHisto(histo,yaxis_title,ymin,ymax,option="HISTOP",draw=True):
ROOT.gStyle.SetPadRightMargin(0.02)
ROOT.gStyle.SetPadLeftMargin(0.07)

histo.SetStats(0)
histo.SetLineWidth(3)
histo.SetMarkerStyle(20)
histo.SetMarkerSize(0.9)
histo.GetYaxis().SetRangeUser(ymin,ymax)
histo.GetYaxis().SetTitle(title)
histo.GetYaxis().SetTitleOffset(1.)
histo.GetYaxis().SetDecimals(1)
histo.GetYaxis().SetMaxDigits(4)
histo.GetYaxis().SetTitle(yaxis_title)
histo.GetXaxis().SetLabelSize(0.04)
histo.GetXaxis().SetTickLength(0.)
histo.LabelsOption("d","X")

fillColor = 0
canvas = None
if draw:
canvas = ROOT.TCanvas("c_" + histo.GetName())
canvas = ROOT.TCanvas("c_" + histo.GetName(), "Default Canvas", 1000, 500)
canvas.SetGridy()
canvas.SetFillColor(fillColor)
if draw: histo.Draw(option)
histo.Draw(option)


linesWh = {}
linesSt = {}
Expand Down
46 changes: 28 additions & 18 deletions CalibMuon/DTCalibration/python/PlottingTools/plotResiduals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@
from .fitResidual import fitResidual
from .drawHistoAllChambers import drawHisto

def plot(fileName,sl,dir='DQMData/Run 1/DT/Run summary/DTCalibValidation',option="HISTOPE1",draw=True):
# This script is not to be run standalone.
# Use CalibMuon/DTCalibration/scripts/allPlotsResiduals.py instead.

mean_ymin = -0.02
mean_ymax = 0.02
sig_ymin = 0.
sig_ymax = 0.07
def plot(fileName,sl,dir='DTResiduals', run='1',option="HISTOPE1",draw=True):

if run in ['390106','390170']:
# These are cosmic Runs
mean_ymin = -0.15
mean_ymax = 0.15
sig_ymin = 0.
sig_ymax = 0.15
else:
mean_ymin = -0.02
mean_ymax = 0.02
sig_ymin = 0.
sig_ymax = 0.07

slType = sl
slStr = "SL%d" % slType
Expand All @@ -22,23 +32,23 @@ def plot(fileName,sl,dir='DQMData/Run 1/DT/Run summary/DTCalibValidation',option
stations = (1,2,3,4)

# (Wh-2 MB1 Sec1 ... Wh-2 MB1 Sec12 ... Wh-1 MB1 Sec1 ... Wh-1 MB1 Sec12 ...)
# (Wh-2 MB2 Sec1 ... Wh-2 MB2 Sec12 ... Wh-1 MB2 Sec1 ... Wh-1 MB1 Sec12 ...) ...
# (Wh-2 MB2 Sec1 ... Wh-2 MB2 Sec12 ... Wh-1 MB2 Sec1 ... Wh-1 MB1 Sec12 ...) ...
nBins = 250
if slType == 2: nBins = 180
histoMean = ROOT.TH1F("h_ResMeanAll","Mean of residuals",nBins,0,nBins)
histoSigma = ROOT.TH1F("h_ResSigmaAll","Sigma of residuals",nBins,0,nBins)
histoMean = ROOT.TH1F("h_ResMeanAll","Mean of residuals for Run=%s at %s" % (run,slStr),nBins,0,nBins)
histoSigma = ROOT.TH1F("h_ResSigmaAll","Sigma of residuals for Run=%s at %s" % (run,slStr),nBins,0,nBins)
for st in stations:
nSectors = 12
if st == 4: nSectors = 14
if st == 4 and slType == 2: continue
if st == 4 and slType == 2: continue
if verbose: print("Station",st)
for wh in wheels:
if verbose: print("Wheel",wh)
if verbose: print("Wheel",wh)
for sec in range(1,nSectors+1):
if verbose: print("Sector",sec)
# Get histogram
histoName = "%s/Wheel%d/Station%d/Sector%d/hResDist_STEP3_W%d_St%d_Sec%d_%s" % (dir,wh,st,sec,wh,st,sec,slStr)
print("Accessing",histoName)
histoName = "%s/Wheel%d/Station%d/Sector%d/hResDist_STEP3_W%d_St%d_Sec%d_%s" % (dir,wh,st,sec,wh,st,sec,slStr)
if verbose: print("Accessing",histoName)
histo = file.Get(histoName)
(histo,fitFunc) = fitResidual(histo,nSigmas,verbose)
fitMean = fitFunc.GetParameter(1)
Expand All @@ -52,16 +62,16 @@ def plot(fileName,sl,dir='DQMData/Run 1/DT/Run summary/DTCalibValidation',option
histoMean.SetBinError(binHistoNew,fitMeanErr)
histoSigma.SetBinContent(binHistoNew,fitSigma)
histoSigma.SetBinError(binHistoNew,fitSigmaErr)

if sec == 1:
label = "Wheel %d" % wh
if wh == -2: label += " MB%d" % st
histoMean.GetXaxis().SetBinLabel(binHistoNew,label)
if wh == -2: label += " MB%d" % st
histoMean.GetXaxis().SetBinLabel(binHistoNew,label)
histoSigma.GetXaxis().SetBinLabel(binHistoNew,label)

objectsMean = drawHisto(histoMean,title="Mean of residuals (cm)",
objectsMean = drawHisto(histoMean,yaxis_title="Mean of residuals (cm)",
ymin=mean_ymin,ymax=mean_ymax,option=option,draw=draw)
objectsSigma = drawHisto(histoSigma,title="Sigma of residuals (cm)",
ymin=sig_ymin,ymax=sig_ymax,option=option,draw=draw)
objectsSigma = drawHisto(histoSigma,yaxis_title="Sigma of residuals (cm)",ymin=sig_ymin,ymax=sig_ymax,option=option,draw=draw)


return (objectsMean,objectsSigma)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def binNumber(station,sector):
start = (station - 1)*12
return start + sector

def plot(fileName,sl,option="HISTOP",draw=True):
def plot(fileName,sl,run="1",option="HISTOP",draw=True):

slType = sl
slStr = "SL%d" % slType
Expand All @@ -21,14 +21,14 @@ def plot(fileName,sl,option="HISTOP",draw=True):
histosWheel = {}
for wh in wheels:
histoName = 'Wheel%d_%s_VDrift' % (wh,slStr)
print("Accessing",histoName)
#print("Accessing",histoName)
histosWheel[wh] = file.Get(histoName)

# (Wh-2 MB1 Sec1 ... Wh-2 MB1 Sec12 ... Wh-1 MB1 Sec1 ... Wh-1 MB1 Sec12 ...)
# (Wh-2 MB2 Sec1 ... Wh-2 MB2 Sec12 ... Wh-1 MB2 Sec1 ... Wh-1 MB1 Sec12 ...) ...
nBins = 250
if slType == 2: nBins = 180
histo = ROOT.TH1F("h_VDriftAll","VDrift",nBins,0,nBins)
histo = ROOT.TH1F("h_VDriftAll_SL%s"%slStr,"VDrift for Run=%s at %s" % (run,slStr),nBins,0,nBins)
for st in stations:
nSectors = 12
if st == 4: nSectors = 14
Expand All @@ -53,9 +53,9 @@ def plot(fileName,sl,option="HISTOP",draw=True):
if wh == -2: label += " MB%d" % st
histo.GetXaxis().SetBinLabel(binHistoNew,label)

objects = drawHisto(histo,
title="v_{drift} (#mum/ns)",
ymin=53,ymax=57,option=option,draw=draw)
objects = drawHisto(histo,
yaxis_title="v_{drift} (#mum/ns)",
ymin=52,ymax=57,option=option,draw=draw)

return objects

Expand Down
36 changes: 22 additions & 14 deletions CalibMuon/DTCalibration/python/Workflow/CrabHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,18 @@ def check_crabtask(self):
print(self.crab_config_filepath)
task = self.crabFunctions.CrabTask(crab_config = self.crab_config_filepath,
initUpdate = False)

if self.options.no_exec:
log.info("Nothing to check in no-exec mode")
return True
for n_check in range(self.options.max_checks):
task.update()
if task.state in ( "COMPLETED"):
print("Crab task complete. Getting output locally")
output_path = os.path.join( self.local_path, "unmerged_results" )
self.get_output_files(task, output_path)
print("Crab task is complete. You can run the next step now.")
#output_path = os.path.join( self.local_path, "unmerged_results" )
#self.get_output_files(task, output_path)
#self.get_output_files(task)
#print("Finished with get_output_files()")
return True
if task.state in ("SUBMITFAILED", "FAILED"):
print("Crab task failed")
Expand All @@ -83,19 +85,24 @@ def check_crabtask(self):
sys.stdout.write("\r")
sys.stdout.write("".join([" " for i in range(tools.getTerminalSize()[0])]))
sys.stdout.write("\r")
prompt_text = "Check (%d/%d). Task state: %s (%s). Press q and enter to stop checks: " % (n_check,
self.options.max_checks, task.state, jobinfos)
prompt_text = "Check (%d/%d). Task state: %s (%s). \nPress q and enter to stop checks: " \
% (n_check, self.options.max_checks, task.state, jobinfos)
user_input = tools.stdinWait(prompt_text, "", self.options.check_interval)
if user_input in ("q","Q"):
if user_input in ["q","Q"]:
return False
print("Task not completed after %d checks (%d minutes)" % ( self.options.max_checks,
int( self.options.check_interval / 60. )))
return False

def voms_proxy_time_left(self):
process = subprocess.Popen(['voms-proxy-info', '-timeleft'],
stdout=subprocess.PIPE)
log.debug("Checking voms_proxy time left")
process = subprocess.Popen('voms-proxy-info -timeleft',
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
shell=True
)
stdout = process.communicate()[0]

if process.returncode != 0:
return 0
else:
Expand Down Expand Up @@ -200,8 +207,7 @@ def fill_options_from_crab_config(self):

@property
def crab(self):
""" Retuns a CrabController instance from cache or creates new
on on first call """
""" Retuns a CrabController instance from cache or creates new one if it is a first call """
if self._crab is None:
if self.cert_info.voGroup:
self._crab = self.crabFunctions.CrabController(voGroup = self.cert_info.voGroup)
Expand All @@ -212,11 +218,13 @@ def crab(self):
@property
def cert_info(self):
if not self._cert_info:
log.debug("No cert info yet. Will try to get it.")
if not self.voms_proxy_time_left() > 0:
warn_msg = "No valid proxy, a default proxy without a specific"
warn_msg = "VOGroup will be used"
self.voms_proxy_create()
warn_msg = "No valid proxy, a default proxy without a specific VOGroup will be used"
log.warning(warn_msg)
log.debug("Trying to create voms_proxy")
self.voms_proxy_create()
log.debug("... voms_proxy is created")
self._cert_info = self.crabFunctions.CertInfo()
return self._cert_info

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class CrabController():
# @param self: A previously defined logger. Crab log messages will use this logger as their parent logger.
def __init__(self, debug=0, logger = None , workingArea = None, voGroup = None, username = None):

#print("Initializing CrabController()")
setConsoleLogLevel(LOGLEVEL_MUTE)
self.debug = debug
if workingArea is not None:
Expand Down Expand Up @@ -186,10 +187,13 @@ def status(self,name):
# @param crabArgs A list of arguments for crab beginning with the command
def callCrabCommand( self, crabArgs ):
crabCommandProcessArgs = (self.crab_q, crabArgs)
print("Will run the callCrabCommand:", crabArgs)
p = Process(target=crabCommandProcess, args=(crabCommandProcessArgs))
p.start()
#print("The (multi)Process() started")
res = self.crab_q.get()
p.join()
print("The Crab command Process has finished.")
return res

## Call crab getlog
Expand Down Expand Up @@ -340,12 +344,13 @@ def crabCommandProcess(q,crabCommandArgs):

class CertInfo:
def __init__( self ):
# print("Running CertInfo() init")
p = subprocess.Popen("voms-proxy-info --fqan",
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
shell=True)
stdout, stderr = p.communicate()
print(stdout)
# print("Grid Certificate:", stdout)
if p.returncode != 0:
self.vo = ""
self.voGroup = ""
Expand All @@ -364,8 +369,7 @@ def __init__( self ):
except:
self.voRole = ""

## Class for a single CrabRequest
#e

# This class represents one crab3 task/request
class CrabTask:

Expand Down Expand Up @@ -398,6 +402,7 @@ def __init__(self,
raise IOError("File %s not found" % crab_config )
self.name = crab_config
self.name = self.crabConfig.General.requestName

self.uuid = uuid.uuid4()
#~ self.lock = multiprocessing.Lock()
#setup logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ def has_crab3_env(self):
return True

def setup_crab_env(self):
log.info('Setting up crab environment')
# following
#http://.com/questions/3503719/emulating-bash-source-in-python
# http://stackoverflow.com/questions/3503719/emulating-bash-source-in-python
command = ['bash', '-c', 'unset module;source /cvmfs/cms.cern.ch/crab3/crab.sh && env']
proc = subprocess.Popen(command, executable = '/bin/bash', stdout = subprocess.PIPE)

print('setting up crab')
for line in proc.stdout:
(key, _, value) = line.partition(b"=")
os.environ[key.decode()] = value.decode().replace("\n","")
Expand Down
Loading