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
Consumes migration for triggerResultsByName #14262
Merged
davidlange6
merged 1 commit into
cms-sw:CMSSW_8_1_X
from
wddgit:consumesTriggerResultsByName
Apr 27, 2016
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,12 +224,13 @@ namespace edmtest { | |
} | ||
} | ||
|
||
edm::TriggerResultsByName resultsByNameHLT = e.triggerResultsByName("HLT"); | ||
if(resultsByNameHLT.isValid() && expectedTriggerResultsHLT_.size() > 0) { | ||
edm::InputTag tag("TriggerResults", "", "HLT"); | ||
edm::Handle<edm::TriggerResults> hTriggerResults; | ||
e.getByLabel(tag, hTriggerResults); | ||
|
||
edm::InputTag tag("TriggerResults", "", "HLT"); | ||
edm::Handle<edm::TriggerResults> hTriggerResults; | ||
e.getByLabel(tag, hTriggerResults); | ||
if(hTriggerResults.isValid() && expectedTriggerResultsHLT_.size() > 0) { | ||
|
||
edm::TriggerResultsByName resultsByNameHLT = e.triggerResultsByName(*hTriggerResults); | ||
|
||
if(hTriggerResults->parameterSetID() != resultsByNameHLT.parameterSetID() || | ||
hTriggerResults->wasrun() != resultsByNameHLT.wasrun() || | ||
|
@@ -269,7 +270,15 @@ namespace edmtest { | |
} | ||
|
||
if(expectedTriggerResultsHLT_.size() > iEvent_) { | ||
edm::TriggerResultsByName resultsByNameHLT = e.triggerResultsByName("HLT"); | ||
|
||
if(!hTriggerResults.isValid()) { | ||
std::cerr << "TestTriggerNames: While testing TriggerResultsByName class\n" | ||
<< "Invalid TriggerResults Handle for HLT" << std::endl; | ||
abort(); | ||
} | ||
|
||
edm::TriggerResultsByName resultsByNameHLT = e.triggerResultsByName(*hTriggerResults); | ||
|
||
if(!resultsByNameHLT.isValid()) { | ||
std::cerr << "TestTriggerNames: While testing TriggerResultsByName class\n" | ||
<< "Invalid object for HLT" << std::endl; | ||
|
@@ -284,8 +293,19 @@ namespace edmtest { | |
<< std::endl; | ||
} | ||
|
||
edm::InputTag tagPROD("TriggerResults", "", "PROD"); | ||
edm::Handle<edm::TriggerResults> hTriggerResultsPROD; | ||
e.getByLabel(tagPROD, hTriggerResultsPROD); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also |
||
|
||
if(expectedTriggerResultsPROD_.size() > iEvent_) { | ||
edm::TriggerResultsByName resultsByNamePROD = e.triggerResultsByName("PROD"); | ||
|
||
if(!hTriggerResultsPROD.isValid()) { | ||
std::cerr << "TestTriggerNames: While testing TriggerResultsByName class\n" | ||
<< "Invalid TriggerResults Handle for PROD" << std::endl; | ||
abort(); | ||
} | ||
|
||
edm::TriggerResultsByName resultsByNamePROD = e.triggerResultsByName(*hTriggerResultsPROD); | ||
if(!resultsByNamePROD.isValid()) { | ||
std::cerr << "TestTriggerNames: While testing TriggerResultsByName class\n" | ||
<< "Invalid object for PROD" << std::endl; | ||
|
@@ -298,13 +318,6 @@ namespace edmtest { | |
} | ||
std::cout << "Event " << iEvent_ << " " << resultsByNamePROD.accept("p1") << std::endl; | ||
} | ||
|
||
edm::TriggerResultsByName resultsByNameNONE = e.triggerResultsByName("NONE"); | ||
if(resultsByNameNONE.isValid()) { | ||
std::cerr << "TestTriggerNames: While testing TriggerResultsByName class\n" | ||
<< "Object is valid with nonexistent process name" << std::endl; | ||
abort(); | ||
} | ||
++iEvent_; | ||
} | ||
|
||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since this is Core code, how about changing to
getByToken
?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.
This a module used only for tests. It has both a call to getManyByType and also getByLabel, both getting the TriggerResults type. There is a consumesMany call that allows both of those to work. I am not sure what happens if you call both consumes to get a token and also consumesMany for the same type.