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 #5631 from Dr15Jones/ioruleForAssociationVector
Attempt to fix dictionary for edm::AssociationVector
- Loading branch information
Showing
9 changed files
with
86 additions
and
27 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
DataFormats/FWLite/test/make_associationvector_file_cfg.py
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,19 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("TEST") | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10)) | ||
|
||
process.vsimple = cms.EDProducer("VSimpleProducer", | ||
size = cms.int32(7) | ||
) | ||
|
||
process.tester = cms.EDProducer("AVSimpleProducer", src = cms.InputTag("vsimple")) | ||
|
||
process.options = cms.untracked.PSet( allowUnscheduled = cms.untracked.bool(True) ) | ||
|
||
process.out = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string("avtester.root")) | ||
|
||
process.o = cms.EndPath(process.out) |
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,24 @@ | ||
#! /usr/bin/env python | ||
|
||
import ROOT | ||
import sys | ||
from DataFormats.FWLite import Events, Handle | ||
events = Events (['avtester.root']) | ||
|
||
handle = Handle ("edm::AssociationVector<edm::RefProd<std::vector<edmtest::Simple> >,std::vector<edmtest::Simple>,edm::Ref<std::vector<edmtest::Simple>,edmtest::Simple,edm::refhelper::FindUsingAdvance<std::vector<edmtest::Simple>,edmtest::Simple> >,unsigned int,edm::helper::AssociationIdenticalKeyReference>") | ||
|
||
label = ("tester","","TEST") | ||
|
||
|
||
# loop over events | ||
count= 0 | ||
for event in events: | ||
#print "###################### ", count | ||
event.getByLabel (label, handle) | ||
cont = handle.product() | ||
values = [ cont.value(i).value for i in xrange(len(cont))] | ||
for i,v in enumerate(handle.product()): | ||
#print v.second.value, values[i] | ||
if v.second.value != values[i]: | ||
raise RuntimeError("Values do not match for event index:{0} from data:{1} from ref:{2}".format(count, v.second.value,values[i])) | ||
count+=1 |
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
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
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
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
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
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
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