CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
BunchSpacingProducer Class Reference
Inheritance diagram for BunchSpacingProducer:
edm::stream::EDProducer<>

Public Member Functions

 BunchSpacingProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) final
 
 ~BunchSpacingProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Attributes

edm::EDGetTokenT< int > bunchSpacing_
 
unsigned int bunchSpacingOverride_
 
bool overRide_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 18 of file BunchSpacingProducer.cc.

Constructor & Destructor Documentation

◆ BunchSpacingProducer()

BunchSpacingProducer::BunchSpacingProducer ( const edm::ParameterSet )
explicit

◆ ~BunchSpacingProducer()

BunchSpacingProducer::~BunchSpacingProducer ( )
override

Definition at line 51 of file BunchSpacingProducer.cc.

51 {}

Member Function Documentation

◆ fillDescriptions()

void BunchSpacingProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 80 of file BunchSpacingProducer.cc.

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

80  {
82  desc.add<bool>("overrideBunchSpacing", false); // true for prompt reco
83  desc.add<unsigned int>("bunchSpacingOverride", 25); // override value
84 
85  descriptions.add("bunchSpacingProducer", desc);
86 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void BunchSpacingProducer::produce ( edm::Event e,
const edm::EventSetup iSetup 
)
final

Definition at line 56 of file BunchSpacingProducer.cc.

References hltParticleFlowClusterECALL1Seeded_cfi::bunchSpacing, bunchSpacing_, bunchSpacingOverride_, MillePedeFileConverter_cfg::e, overRide_, and writedatasetfile::run.

56  {
57  if (overRide_) {
58  e.put(std::make_unique<unsigned int>(bunchSpacingOverride_));
59  return;
60  }
61 
62  unsigned int bunchSpacing = 50;
63  unsigned int run = e.run();
64 
65  if (e.isRealData()) {
66  if ((run > 252126 && run != 254833) || run == 178003 || run == 178004 || run == 209089 || run == 209106 ||
67  run == 209109 || run == 209146 || run == 209148 || run == 209151) {
68  bunchSpacing = 25;
69  }
70  } else {
71  edm::Handle<int> bunchSpacingH;
72  e.getByToken(bunchSpacing_, bunchSpacingH);
73  bunchSpacing = *bunchSpacingH;
74  }
75 
76  e.put(std::make_unique<unsigned int>(bunchSpacing));
77  return;
78 }
unsigned int bunchSpacingOverride_
edm::EDGetTokenT< int > bunchSpacing_

Member Data Documentation

◆ bunchSpacing_

edm::EDGetTokenT<int> BunchSpacingProducer::bunchSpacing_
private

Definition at line 29 of file BunchSpacingProducer.cc.

Referenced by produce().

◆ bunchSpacingOverride_

unsigned int BunchSpacingProducer::bunchSpacingOverride_
private

Definition at line 30 of file BunchSpacingProducer.cc.

Referenced by produce().

◆ overRide_

bool BunchSpacingProducer::overRide_
private

Definition at line 31 of file BunchSpacingProducer.cc.

Referenced by produce().