Skip to content

Commit

Permalink
avoid repeated seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
kpedro88 committed Aug 25, 2017
1 parent fb66457 commit 457804c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions PhysicsTools/PatUtils/interface/SmearedJetProducerT.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> {
JME::JetResolution resolution;
JME::JetResolutionScaleFactor resolution_sf;

const JetCollection& jets = *jets_collection;

if (m_enabled) {
if (m_use_txt_files) {
resolution = *m_resolution_from_file;
Expand All @@ -205,14 +207,14 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> {

if(m_useDeterministicSeed) {
unsigned int runNum_uint = static_cast <unsigned int> (event.id().run());
unsigned int evNum_uint = static_cast <unsigned int> (event.id().event());
std::uint32_t seed = runNum_uint + 4*evNum_uint;
unsigned int lumiNum_uint = static_cast <unsigned int> (event.id().luminosityBlock());
unsigned int evNum_uint = static_cast <unsigned int> (event.id().event());
unsigned int jet0pt = uint32_t(jets.empty() ? 0 : jets[0].pt()/0.01);
std::uint32_t seed = jet0pt + (lumiNum_uint<<10) + (runNum_uint<<20) + evNum_uint;
m_random_generator.seed(seed);
}
}

const JetCollection& jets = *jets_collection;

if (m_genJetMatcher)
m_genJetMatcher->getTokens(event);

Expand Down

0 comments on commit 457804c

Please sign in to comment.