Skip to content

Commit

Permalink
Merge pull request #28873 from intrepid42/RivetTests
Browse files Browse the repository at this point in the history
Basic Rivet tests
  • Loading branch information
cmsbuild authored Feb 7, 2020
2 parents 61f6cf4 + 08b90ac commit e946a97
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
CrossSection = cms.double(-1),
DoFinalize = cms.bool(True),
ProduceDQMOutput = cms.bool(False),
OutputFile = cms.string('out.aida')
OutputFile = cms.string('out.yoda')
)
2 changes: 2 additions & 0 deletions GeneratorInterface/RivetInterface/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<test name="test-rivet-list" command="test-rivet-list.sh"/>
<test name="test-rivet-run" command="test-rivet-run.sh"/>
20 changes: 5 additions & 15 deletions GeneratorInterface/RivetInterface/test/rivet_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(10000)
input = cms.untracked.int32(100)
)

# Input source
Expand Down Expand Up @@ -82,9 +82,11 @@
)
)

process.load("GeneratorInterface.RivetInterface.rivetAnalyzer_cfi")
process.rivetAnalyzer.AnalysisNames = cms.vstring('MC_GENERIC', 'CMS_2013_I1224539_DIJET', 'CMS_2014_I1305624')

# Path and EndPath definitions
process.generation_step = cms.Path(process.pgen)
process.generation_step = cms.Path(process.pgen*process.rivetAnalyzer)
process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
process.endjob_step = cms.EndPath(process.endOfProcess)
process.RAWSIMoutput_step = cms.EndPath(process.RAWSIMoutput)
Expand All @@ -93,16 +95,4 @@
process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.endjob_step,process.RAWSIMoutput_step)
# filter all path with the production filter sequence
for path in process.paths:
getattr(process,path)._seq = process.generator * getattr(process,path)._seq

# customisation of the process.

# Automatic addition of the customisation function from Configuration.GenProduction.rivet_customize
from Configuration.GenProduction.rivet_customize import customise

#call to customisation function customise imported from Configuration.GenProduction.rivet_customize
process = customise(process)

# End of customisation functions
process.rivetAnalyzer.AnalysisNames = cms.vstring('CMS_2013_I1224539_DIJET')
process.rivetAnalyzer.OutputFile = cms.string('mcfile.yoda')
getattr(process,path)._seq = process.generator * getattr(process,path)._seq
3 changes: 3 additions & 0 deletions GeneratorInterface/RivetInterface/test/test-rivet-list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -e

rivet --list-analyses | grep MC_GENERIC
3 changes: 3 additions & 0 deletions GeneratorInterface/RivetInterface/test/test-rivet-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -e

cmsRun ${CMSSW_BASE}/src/GeneratorInterface/RivetInterface/test/rivet_cfg.py

0 comments on commit e946a97

Please sign in to comment.