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
migration from EDProducer to stream::EDProducer (BeamSpotOnlineProducer) #6671
Merged
cmsbuild
merged 2 commits into
cms-sw:CMSSW_7_4_X
from
mtosi:from-CMSSW_7_4_X_2014-11-27-0200_multithread_onlineBS
Dec 9, 2014
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,21 +15,16 @@ using namespace edm; | |
|
||
|
||
BeamSpotOnlineProducer::BeamSpotOnlineProducer(const ParameterSet& iconf) | ||
: changeFrame_ ( iconf.getParameter<bool> ("changeToCMSCoordinates") ) | ||
, theMaxZ ( iconf.getParameter<double>("maxZ") ) | ||
, theSetSigmaZ ( iconf.getParameter<double>("setSigmaZ") ) | ||
, scalerToken_ ( consumes<BeamSpotOnlineCollection> ( iconf.getParameter<InputTag>("src") ) ) | ||
, l1GtEvmReadoutRecordToken_ ( consumes<L1GlobalTriggerEvmReadoutRecord>( iconf.getParameter<InputTag>("gtEvmLabel")) ) | ||
, theBeamShoutMode ( iconf.getUntrackedParameter<int> ("beamMode",11) ) | ||
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. Shouldn't this be a tracked parameter? 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. I take that back, it is just used to make the code verbose. Untracked is the proper type. |
||
{ | ||
|
||
scalerToken_ = consumes<BeamSpotOnlineCollection>( | ||
iconf.getParameter<InputTag>("src")); | ||
|
||
changeFrame_ = iconf.getParameter<bool>("changeToCMSCoordinates"); | ||
|
||
theMaxR2 = iconf.getParameter<double>("maxRadius"); | ||
theMaxR2*=theMaxR2; | ||
theMaxZ = iconf.getParameter<double>("maxZ"); | ||
|
||
theSetSigmaZ = iconf.getParameter<double>("setSigmaZ"); | ||
|
||
l1GtEvmReadoutRecordToken_ = consumes<L1GlobalTriggerEvmReadoutRecord>( | ||
iconf.getParameter<InputTag>("gtEvmLabel")); | ||
|
||
produces<reco::BeamSpot>(); | ||
|
||
|
@@ -45,7 +40,7 @@ BeamSpotOnlineProducer::produce(Event& iEvent, const EventSetup& iSetup) | |
edm::Handle<L1GlobalTriggerEvmReadoutRecord> gtEvmReadoutRecord; | ||
if (iEvent.getByToken(l1GtEvmReadoutRecordToken_, gtEvmReadoutRecord)){ | ||
const boost::uint16_t beamModeValue = (gtEvmReadoutRecord->gtfeWord()).beamMode(); | ||
if (beamModeValue == 11) shoutMODE=true; | ||
if (beamModeValue == theBeamShoutMode) shoutMODE=true; | ||
} | ||
else{ | ||
shoutMODE=true; | ||
|
@@ -87,7 +82,7 @@ BeamSpotOnlineProducer::produce(Event& iEvent, const EventSetup& iSetup) | |
|
||
aSpot = reco::BeamSpot( apoint, | ||
sigmaZ, | ||
spotOnline.dxdz(), | ||
spotOnline.dxdz(), | ||
f* spotOnline.dydz(), | ||
spotOnline.width_x(), | ||
matrix); | ||
|
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.
why do we need boost:: type here.
It's also not good that the underlying parameter in python is a plain int, which can lead to surprises.
Please use the same type
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.
it was boost in the original code,
and sorry but I do not know the answer to your question :(
but I can follow your suggestion ....
I'm a little bit confused, though,
because looking at https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideAboutPythonConfigFile#Parameters
I do not find any boost::uint16_t
I'll set in line 23 like
, theBeamShoutMode ( iconf.getUntrackedParameter ("beamMode",11) )
is it fine ?
thanks
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 original code in .cc was
note that the typedef for the beamMode is actually cms_uint16_t without boost::.
I suggest to switch to
unsigned int theBeamShoutMode
and uint32 in pythonThere 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.
==>
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.
thanks !
I'm updating the PR