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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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.

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 }

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

◆ produce()

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

Definition at line 56 of file BunchSpacingProducer.cc.

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 }

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

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().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle< int >
BunchSpacingProducer::bunchSpacing_
edm::EDGetTokenT< int > bunchSpacing_
Definition: BunchSpacingProducer.cc:29
BunchSpacingProducer::overRide_
bool overRide_
Definition: BunchSpacingProducer.cc:31
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
writedatasetfile.run
run
Definition: writedatasetfile.py:27
BunchSpacingProducer::bunchSpacingOverride_
unsigned int bunchSpacingOverride_
Definition: BunchSpacingProducer.cc:30
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37