CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
BunchSpacingProducer Class Reference
Inheritance diagram for BunchSpacingProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 BunchSpacingProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) overridefinal
 
 ~BunchSpacingProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 18 of file BunchSpacingProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 57 of file BunchSpacingProducer.cc.

57  {
58 }

Member Function Documentation

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

Definition at line 100 of file BunchSpacingProducer.cc.

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

101 {
103  desc.add<bool>("overrideBunchSpacing",false); // true for prompt reco
104  desc.add<unsigned int>("bunchSpacingOverride",25); // override value
105 
106  descriptions.add("bunchSpacingProducer",desc) ;
107 }
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 
)
finaloverridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 63 of file BunchSpacingProducer.cc.

References bunchSpacing_, bunchSpacingOverride_, edm::Event::getByToken(), edm::EventBase::isRealData(), overRide_, edm::Event::put(), DTTTrigCorrFirst::run, and edm::Event::run().

64 {
65  if ( overRide_ ) {
66  std::auto_ptr<unsigned int> pOut1(new unsigned int);
67  *pOut1=bunchSpacingOverride_;
68  e.put(pOut1);
69  return;
70  }
71 
72  unsigned int bunchSpacing=50;
73  unsigned int run=e.run();
74 
75  if ( e.isRealData()) {
76  if ( ( run > 252126 && run != 254833 )||
77  run == 178003 ||
78  run == 178004 ||
79  run == 209089 ||
80  run == 209106 ||
81  run == 209109 ||
82  run == 209146 ||
83  run == 209148 ||
84  run == 209151) {
85  bunchSpacing = 25;
86  }
87  }
88  else{
89  edm::Handle<int> bunchSpacingH;
90  e.getByToken(bunchSpacing_,bunchSpacingH);
91  bunchSpacing = *bunchSpacingH;
92  }
93 
94  std::auto_ptr<unsigned int> pOut1(new unsigned int);
95  *pOut1=bunchSpacing;
96  e.put(pOut1);
97  return;
98 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
unsigned int bunchSpacingOverride_
bool isRealData() const
Definition: EventBase.h:63
edm::EDGetTokenT< int > bunchSpacing_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
RunNumber_t run() const
Definition: Event.h:93

Member Data Documentation

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

Definition at line 32 of file BunchSpacingProducer.cc.

Referenced by produce().

unsigned int BunchSpacingProducer::bunchSpacingOverride_
private

Definition at line 33 of file BunchSpacingProducer.cc.

Referenced by produce().

bool BunchSpacingProducer::overRide_
private

Definition at line 34 of file BunchSpacingProducer.cc.

Referenced by produce().