-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Modifiers not being set properly in EventConfig for data (GEM RecHits not in latest data) #38622
Conversation
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38622/30912 ERROR: Unable to merge PR. See log https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38622/30912/cms-checkout-topic.log |
…generating config
c51a991
to
f2c154c
Compare
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-da417a/26035/summary.html The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: You can see more details here: Comparison SummarySummary:
|
@perrotta, @davidlange6, @germanfgv Configuration/DataProcessing/test/RunPromptReco.py creates an instance of Process class using child classes of Scenario class. from Configuration.DataProcessing.GetScenario import getScenario
class RunPromptReco:
def __call__(self):
...
try:
scenario = getScenario(self.scenario) # NOTE: our self.scenario is "ppEra_Run3"
...
process = scenario.promptReco(self.globalTag, **kwds)
... So, we need to investigate from Configuration.DataProcessing.Scenario import *
class Reco(Scenario):
def __init__(self):
...
self.cbSc=self.__class__.__name__
self.promptModifiers = cms.ModifierChain()
...
def promptReco(self, globalTag, **args):
# NOTE: args (deliverd by RunPromptReco.py) == {'outputs': [{'dataTier': 'RECO', 'eventContent': 'RECO', 'moduleLabel': 'write_RECO'}]}
...
options = Options()
options.__dict__.update(defaultOptions.__dict__)
options.scenario = self.cbSc % NOTE self.cbSc == "pp"
options.step = 'RAW2DIGI,L1Reco,RECO'+self.recoSeq+eiStep+step+PhysicsSkimStep+miniAODStep+',DQM'+dqmStep+',ENDJOB'
...
process = cms.Process('RECO', cms.ModifierChain(self.eras, self.promptModifiers) )
cb = ConfigBuilder(options, process = process, with_output = True)
cb.prepare()
...
return process Let's keep track of Configuration/DataProcessing/python/Scenario.py loaded the from Configuration.DataProcessing.Repack import repackProcess
class Scenario(object):
... Configuration/DataProcessing/python/Repack.py loads ...
from Configuration.EventContent.EventContent_cff import RAWEventContent
...
def repackProcess(**args):
... However, class Modifier(object):
def __init__(self):
self.__chosen = False
def toModify(self,obj, func=None,**kw):
Modifier._toModifyCheck(obj,func,**kw)
if not self._isChosen():
return
Modifier._toModify(obj,func,**kw)
def _setChosen(self):
"""Should only be called by cms.Process instances"""
self.__chosen = True
def _isChosen(self):
return self.__chosen class Process(object):
def __init__(self,name,*Mods):
...
self.__dict__['_Process__modifiers'] = Mods
...
for m in self.__modifiers:
m._setChosen() Then, back to from Configuration.DataProcessing.Scenario import *
class Reco(Scenario):
def __init__(self):
...
self.cbSc=self.__class__.__name__
self.promptModifiers = cms.ModifierChain()
...
def promptReco(self, globalTag, **args):
# NOTE: args (deliverd by RunPromptReco.py) == {'outputs': [{'dataTier': 'RECO', 'eventContent': 'RECO', 'moduleLabel': 'write_RECO'}]}
...
options = Options()
options.__dict__.update(defaultOptions.__dict__)
options.scenario = self.cbSc % NOTE self.cbSc == "pp"
options.step = 'RAW2DIGI,L1Reco,RECO'+self.recoSeq+eiStep+step+PhysicsSkimStep+miniAODStep+',DQM'+dqmStep+',ENDJOB'
...
process = cms.Process('RECO', cms.ModifierChain(self.eras, self.promptModifiers) )
cb = ConfigBuilder(options, process = process, with_output = True)
cb.prepare()
...
return process In Configuration/Applications/python/ConfigBuilder.py, we meet the event content configuration file. In the Please refer When I edit an imported module and reimport it, the changes don’t show up. Why does this happen? for more details. class ConfigBuilder(object):
def __init__(self, options, process = None, with_output = False, with_input = False ):
...
self.EVTCONTDefaultCFF="Configuration/EventContent/EventContent_cff"
...
if self._options.scenario=='cosmics':
...
self.EVTCONTDefaultCFF="Configuration/EventContent/EventContentCosmics_cff"
...
if self._options.scenario=='HeavyIons':
...
self.EVTCONTDefaultCFF="Configuration/EventContent/EventContentHeavyIons_cff"
...
def loadAndRemember(self, includeFile):
"""helper routine to load am memorize imports"""
# we could make the imports a on-the-fly data method of the process instance itself
# not sure if the latter is a good idea
includeFile = includeFile.replace('/','.')
self.imports.append(includeFile)
self.process.load(includeFile)
return sys.modules[includeFile]
def prepare(self, doChecking = False):
""" Prepare the configuration string and add missing pieces."""
self.loadAndRemember(self.EVTCONTDefaultCFF) #load the event contents regardless
... class Process(object):
def load(self, moduleName):
moduleName = moduleName.replace("/",".")
module = __import__(moduleName)
self.extend(sys.modules[moduleName]) Let me just recap what's happened.
Let me know if anything is unclear. |
this analysis makes sense; good catch. |
IIUC, only |
urgent |
urgent
|
+1
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will be automatically merged. |
@perrotta, This PR should be backported to 12_3_X and 12_4_x, right? We're ready to backport this PR to 12_3_X and 12_4_X. |
…ess.__init__`. Refer to cms-sw#38622 (comment) for more details. The new line is added to EOF by vim
…ess.__init__`. Refer to cms-sw#38622 (comment) for more details.
…rom-CMSSW_12_4_X_2022-07-08-2300 Modifiers not being set properly in EventConfig for data (backport of #38622, 12_4_X)
…rom-CMSSW_12_3_X_2022-07-10-2300 Modifiers not being set properly in EventConfig for data (backport of #38622, 12_3_X)
No, that's not how it works. Repack.py is not used in prompt reco (just check it yourself to see if there is any change with your PR or by introducing random stuff in repack.py)
On Jul 7, 2022 10:29 AM, "Ian J. Watson" ***@***.***> wrote:
For example:
edmDumpEventContent root://eoscms.cern.ch//eos/cms/tier0//store/data/Run2022A/SingleMuon/AOD/PromptReco-v1/000/354/964/00000/0afb1f87-43db-42bf-989b-768d7ce882b7.root
has no rechits (from July 3), while
input_file=/store/data/Commissioning2022/MinimumBias/AOD/PromptReco-v1/000/351/020/00000/2a56da7f-049d-49e7-95a5-7cc4fdb5d74e.root
edmDumpEventContent root://cmsxrootd-site.fnal.gov/${input_file}
does (from April, just before the change to Repack.py). The issue seems to be that EventContent is pulled in in Repack and cached, so the modifiers don't run when its pulled in later in the actual process (at least, if you generate the config pickle with the Configuration/DataProcessing/test/RunPromptReco.py method I indicated).
—
Reply to this email directly, view it on GitHub<#38622 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABGPFQYFOFXNNXU53A4GJGLVS2ILDANCNFSM52362F5A>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
PR description:
We noticed there are no GEM rechits being added to the data output recently (in particular in the latest collision events), and when trying out Configuration/DataProcessing/test/RunPromptReco.py to see what gets added, I traced it back to Configuration/DataProcessing/python/Repack.py loading Configuration.EventContent.EventContent_cff before the era is set (it gets set after Scenario.py is loaded, which is loading Repack.py), so that modifier chains don't seem to be included at all. In particular, the run3_GEM modifier chain in RecoLocalMuon/Configuration/python/RecoLocalMuon_EventContent_cff.py is not set when the EventContent is loaded by the Repack.py file (but would be if the eras are set by the scenario before the EventContent cff is loaded). Could someone clarify if my understanding is correct but this is expected (it appears the change to Repack.py was made 2 months ago?), or if not expected is the fix okay and should I backport this? Otherwise let me know if my understanding is wrong.
@jshlee
@slowmoyang
PR validation:
Checked the output of Configuration/DataProcessing/test/RunPromptReco.py with ppEra_Run3 scenario before and after the change:
before the local muon content looks like:
after:
I used the command
If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:
Before submitting your pull requests, make sure you followed this checklist: