-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47060 from Dr15Jones/updateRefTest
Updated test of edm::Ref use from a merged ROOT file
- Loading branch information
Showing
6 changed files
with
110 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test ConditionalTasks.') | ||
|
||
parser.add_argument("--inFile1", help="first file to read") | ||
parser.add_argument("--inFile2", help="second file to read") | ||
parser.add_argument("--outFile", help="name of output file", default="ref_merge.root") | ||
|
||
args = parser.parse_args() | ||
|
||
process = cms.Process("MERGE") | ||
|
||
process.source = cms.Source("PoolSource", | ||
fileNames = cms.untracked.vstring("file:ref_merge_prod1.root", | ||
"file:ref_merge_prod2.root") | ||
from IOPool.Input.modules import PoolSource | ||
process.source = PoolSource(fileNames = [f"file:{args.inFile1}", | ||
f"file:{args.inFile2}"] | ||
) | ||
|
||
process.out = cms.OutputModule("PoolOutputModule", | ||
fileName = cms.untracked.string("ref_merge.root") | ||
) | ||
from IOPool.Output.modules import PoolOutputModule | ||
process.out = PoolOutputModule(fileName = args.outFile) | ||
|
||
process.tester = cms.EDAnalyzer("OtherThingAnalyzer", | ||
other = cms.untracked.InputTag("d","testUserTag")) | ||
from FWCore.Integration.modules import OtherThingAnalyzer | ||
process.tester = OtherThingAnalyzer(other = ("d","testUserTag")) | ||
|
||
process.o = cms.EndPath(process.out+process.tester) | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test ConditionalTasks.') | ||
|
||
parser.add_argument("--extraProducers", help="Add extra producers to configuration", action="store_true") | ||
parser.add_argument("--fileName", help="name of output file") | ||
parser.add_argument("--firstLumi", help="LuminosityBlock number for first lumi", type = int, default=1) | ||
parser.add_argument("--keepAllProducts", help="Keep all products made in the job", action="store_true") | ||
parser.add_argument("--dropThings", help="drop the Things collections so the refs will not function", action="store_true") | ||
|
||
args = parser.parse_args() | ||
|
||
|
||
process = cms.Process("PROD") | ||
|
||
nEvents = 10 | ||
from FWCore.Modules.modules import EmptySource | ||
process.source = EmptySource( | ||
firstLuminosityBlock = args.firstLumi, | ||
firstEvent = nEvents*(args.firstLumi-1)+1 | ||
) | ||
|
||
process.maxEvents.input = nEvents | ||
|
||
if args.extraProducers: | ||
from FWCore.Framework.modules import IntProducer | ||
process.a = IntProducer(ivalue = 1) | ||
|
||
process.b = IntProducer(ivalue = 2) | ||
|
||
from FWCore.Integration.modules import ThingProducer, OtherThingProducer, OtherThingAnalyzer | ||
process.c = ThingProducer() | ||
|
||
process.d = OtherThingProducer(thingTag="c") | ||
|
||
outputs = [] | ||
if not args.keepAllProducts: | ||
outputs = ["drop *", | ||
"keep edmtestOtherThings_*_*_*"] | ||
if not args.dropThings: | ||
outputs.append("keep edmtestThings_*_*_*") | ||
|
||
|
||
from IOPool.Output.modules import PoolOutputModule | ||
process.o = PoolOutputModule(outputCommands = outputs, | ||
fileName = args.fileName | ||
) | ||
if args.extraProducers: | ||
process.p = cms.Path(process.a+process.b+process.c*process.d) | ||
else: | ||
process.p = cms.Path(process.c*process.d) | ||
|
||
process.tester = OtherThingAnalyzer(other = ("d","testUserTag")) | ||
|
||
process.out = cms.EndPath(process.o+process.tester) | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test Refs after merge.') | ||
|
||
parser.add_argument("--fileName", help="file to read") | ||
|
||
args = parser.parse_args() | ||
|
||
process = cms.Process("TEST") | ||
|
||
process.source = cms.Source("PoolSource", | ||
fileNames = cms.untracked.vstring("file:ref_merge.root") | ||
) | ||
from IOPool.Input.modules import PoolSource | ||
process.source = PoolSource(fileNames = [f"file:{args.fileName}"]) | ||
|
||
process.tester = cms.EDAnalyzer("OtherThingAnalyzer", | ||
other = cms.untracked.InputTag("d","testUserTag")) | ||
from FWCore.Integration.modules import OtherThingAnalyzer | ||
process.tester = OtherThingAnalyzer(other = ("d","testUserTag")) | ||
|
||
process.e = cms.EndPath(process.tester) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters