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 46 of file BunchSpacingProducer.cc.

46 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 75 of file BunchSpacingProducer.cc.

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

75  {
77  desc.add<bool>("overrideBunchSpacing", false); // true for prompt reco
78  desc.add<unsigned int>("bunchSpacingOverride", 25); // override value
79 
80  descriptions.add("BunchSpacingProducer", desc);
81 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 51 of file BunchSpacingProducer.cc.

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

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