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
bug fix to read non-edm hepmc files in 71 #18917
Conversation
…be compatible with SIM-DIGI-RECO workflow
A new Pull Request was created by @perrozzi for CMSSW_7_1_X. It involves the following packages: IOMC/Input @smuzaffar, @civanch, @Dr15Jones, @mdhildreth, @cmsbuild, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@amarini @intrepid42 trying to move this to cmssw, feel free to comment |
please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
@@ -32,7 +33,8 @@ MCFileSource::MCFileSource(const ParameterSet & pset, InputSourceDescription con | |||
} | |||
|
|||
reader_->initialize(fileName); | |||
produces<HepMCProduct>(); | |||
produces<HepMCProduct>("generator"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change the product instance label?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I remember correctly, if otherwise the following stage (SIM) gives an error because expects "generator"
@amarini can you please comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need this later on:
process.g4SimHits.Generator.HepMCProductLabel = 'source:generator'
process.genParticles.src = 'source:generator'
(instead of just source
, so it does not make too much difference)
Or is it possible to label the source module as process.generator
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sources are not allowed to have a label. However, Source are allowed to provide data products from 'earlier' Process. Therefore it would be possible to have the source create a data product using the 'generator' module label for a made up earlier process (say 'MCFileGen'). However the base class used by MCFileSource
does not support creation of 'earlier' Processes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a solution then?!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified the following stages as well in the code to take generic Input tags that can be configured in python when running
process.genParticles.src= cms.InputTag("source","generator")
process.g4SimHits.HepMCProductLabel = cms.InputTag("source","generator")
process.g4SimHits.Generator.HepMCProductLabel = cms.InputTag("source","generator")
and as well the output commands needs to retain the gen information:
process.AODSIMoutput.outputCommands.extend([
'keep GenRunInfoProduct_*_*_*',
'keep GenLumiInfoProduct_*_*_*',
'keep GenEventInfoProduct_*_*_*',
])
process.MINIAODSIMoutput.outputcommands.extend([
'keep GenRunInfoProduct_*_*_*',
'keep GenLumiInfoProduct_*_*_*',
'keep GenEventInfoProduct_*_*_*',
])
The choice to mark it with label 'generator' was for clarity since 'source' is not a very descriptive collection name.
Anyhow, if put or not, the changes to InputTags are still needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LHESource does handle creating an 'earlier' Process and then adding a different module label for the data products it makes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so just to be sure I follow - the vertex smearing is applied before this module runs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I understand correctly your question, the module concerned by this PR needs to run before the vertex smearing as is needed to import into EDM format a showered set of events in HepMC format
Comparison is ready Comparison Summary:
|
I just noticed that genParticles are not written into the edm file :s |
Standard sequences can produce gen particles from edm HepMC files. I was using something like: process.GEN = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('HepMC_GEN.root')
)
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('GeneratorInterface.Core.genFilterSummary_cff')
process.load('Configuration.StandardSequences.Generator_cff')
process.genParticles.src= cms.InputTag("source","generator")
process.p = cms.Path(process.genParticles)
process.outpath = cms.EndPath(process.GEN) |
@Dr15Jones what shall we do? |
@amarini Ok, thank you, it works like this:
with the usual generation_step
|
+1 |
+1 |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_1_X IBs (tests are also fine) and once validation in the development release cycle CMSSW_9_2_X is complete. This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @smuzaffar |
otherwise this needs a master branch PR and test. |
@amarini can you remind me if this was needed only in 71X? |
@amarini ping |
I think this is needed as well for newer versions, but for porting rebase is not enough, because some Input Tags in the reconstruction changed. |
Port to 9x in #19523 |
+1 |
basically substitute string with inputTag
code adapted from @amarini