CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( const edm::ParameterSet )
explicit
BunchSpacingProducer::~BunchSpacingProducer ( )
override

Definition at line 51 of file BunchSpacingProducer.cc.

51 {}

Member Function Documentation

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

Definition at line 80 of file BunchSpacingProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::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 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void BunchSpacingProducer::produce ( edm::Event e,
const edm::EventSetup iSetup 
)
final

Definition at line 56 of file BunchSpacingProducer.cc.

References bunchSpacing_, bunchSpacingOverride_, edm::Event::getByToken(), edm::EventBase::isRealData(), overRide_, edm::Event::put(), edm::Event::run(), and submitPVValidationJobs::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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
unsigned int bunchSpacingOverride_
bool isRealData() const
Definition: EventBase.h:62
edm::EDGetTokenT< int > bunchSpacing_
RunNumber_t run() const
Definition: Event.h:109

Member Data Documentation

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

Definition at line 29 of file BunchSpacingProducer.cc.

Referenced by produce().

unsigned int BunchSpacingProducer::bunchSpacingOverride_
private

Definition at line 30 of file BunchSpacingProducer.cc.

Referenced by produce().

bool BunchSpacingProducer::overRide_
private

Definition at line 31 of file BunchSpacingProducer.cc.

Referenced by produce().