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 Member Functions | Private Attributes
L1TExtCondProducer Class Reference
Inheritance diagram for L1TExtCondProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1TExtCondProducer (const ParameterSet &)
 
 ~L1TExtCondProducer ()
 
- 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 (ConfigurationDescriptions &descriptions)
 
- 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 Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

int bxFirst_
 
int bxLast_
 
std::map< std::string,
unsigned int > 
m_extBitMap
 
unsigned long long m_l1GtMenuCacheID
 
bool setBptxAND_
 
bool setBptxMinus_
 
bool setBptxOR_
 
bool setBptxPlus_
 

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 47 of file L1TExtCondProducer.cc.

Constructor & Destructor Documentation

L1TExtCondProducer::L1TExtCondProducer ( const ParameterSet iConfig)
explicit

Definition at line 79 of file L1TExtCondProducer.cc.

References m_l1GtMenuCacheID.

79  :
80  bxFirst_ (iConfig.getParameter<int>("bxFirst")),
81  bxLast_ (iConfig.getParameter<int>("bxLast")),
82  setBptxAND_ (iConfig.getParameter<bool>("setBptxAND")),
83  setBptxPlus_ (iConfig.getParameter<bool>("setBptxPlus")),
84  setBptxMinus_ (iConfig.getParameter<bool>("setBptxMinus")),
85  setBptxOR_ (iConfig.getParameter<bool>("setBptxOR"))
86  {
87  // register what you produce
88  produces<GlobalExtBlkBxCollection>();
89 
90  // Initialize parameters
91  m_l1GtMenuCacheID = 0ULL;
92  }
T getParameter(std::string const &) const
unsigned long long m_l1GtMenuCacheID
L1TExtCondProducer::~L1TExtCondProducer ( )

Definition at line 95 of file L1TExtCondProducer.cc.

96  {
97  }

Member Function Documentation

void L1TExtCondProducer::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 160 of file L1TExtCondProducer.cc.

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

160  {
161  // simGtExtFakeProd
163  desc.add<bool>("setBptxMinus", true);
164  desc.add<bool>("setBptxAND", true);
165  desc.add<int>("bxFirst", -2);
166  desc.add<bool>("setBptxOR", true);
167  desc.add<int>("bxLast", 2);
168  desc.add<bool>("setBptxPlus", true);
169  descriptions.add("simGtExtFakeProd", desc);
170  }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void L1TExtCondProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 107 of file L1TExtCondProducer.cc.

References edm::EventSetup::get(), l1t::TriggerMenuParser::getExternalSignals(), LogDebug, edm::ESHandle< class >::product(), edm::Event::put(), and GlobalExtBlk::setExternalDecision().

108  {
109 
110  LogDebug("L1TExtCondProducer") << "L1TExtCondProducer::produce function called...\n";
111 
112  // get / update the trigger menu from the EventSetup
113  // local cache & check on cacheIdentifier
114  unsigned long long l1GtMenuCacheID = iSetup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
115 
116  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
117 
119  iSetup.get< L1TUtmTriggerMenuRcd>().get(l1GtMenu) ;
120  const L1TUtmTriggerMenu* utml1GtMenu = l1GtMenu.product();
121 
122  // Instantiate Parser
123  TriggerMenuParser gtParser = TriggerMenuParser();
124 
125  std::map<std::string, unsigned int> extBitMap = gtParser.getExternalSignals(utml1GtMenu);
126 
127  m_l1GtMenuCacheID = l1GtMenuCacheID;
128  m_extBitMap = extBitMap;
129  }
130 
131  // Setup vectors
132  GlobalExtBlk extCond_bx;
133 
134  //outputs
135  std::auto_ptr<GlobalExtBlkBxCollection> extCond( new GlobalExtBlkBxCollection(0,bxFirst_,bxLast_));
136 
137  bool foundBptxAND = ( m_extBitMap.find("BPTX_plus_AND_minus.v0")!=m_extBitMap.end() );
138  bool foundBptxPlus = ( m_extBitMap.find("BPTX_plus.v0")!=m_extBitMap.end() );
139  bool foundBptxMinus = ( m_extBitMap.find("BPTX_minus.v0")!=m_extBitMap.end() );
140  bool foundBptxOR = ( m_extBitMap.find("BPTX_plus_OR_minus.v0")!=m_extBitMap.end() );
141 
142  // Fill in some external conditions for testing
143  if( setBptxAND_ && foundBptxAND ) extCond_bx.setExternalDecision(m_extBitMap["BPTX_plus_AND_minus.v0"],true);
144  if( setBptxPlus_ && foundBptxPlus ) extCond_bx.setExternalDecision(m_extBitMap["BPTX_plus.v0"],true);
145  if( setBptxMinus_ && foundBptxMinus ) extCond_bx.setExternalDecision(m_extBitMap["BPTX_minus.v0"],true);
146  if( setBptxOR_ && foundBptxOR ) extCond_bx.setExternalDecision(m_extBitMap["BPTX_plus_OR_minus.v0"],true);
147 
148  // Fill Externals
149  for( int iBx=bxFirst_; iBx<=bxLast_; iBx++ ){
150  extCond->push_back(iBx, extCond_bx);
151  }
152 
153 
154  iEvent.put(extCond);
155 
156  }
#define LogDebug(id)
BXVector< GlobalExtBlk > GlobalExtBlkBxCollection
Definition: GlobalExtBlk.h:30
std::map< std::string, unsigned int > getExternalSignals(const L1TUtmTriggerMenu *utmMenu)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
void setExternalDecision(unsigned int bit, bool val)
Set decision bits.
Definition: GlobalExtBlk.cc:52
unsigned long long m_l1GtMenuCacheID
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
std::map< std::string, unsigned int > m_extBitMap

Member Data Documentation

int L1TExtCondProducer::bxFirst_
private

Definition at line 64 of file L1TExtCondProducer.cc.

int L1TExtCondProducer::bxLast_
private

Definition at line 65 of file L1TExtCondProducer.cc.

std::map<std::string, unsigned int> L1TExtCondProducer::m_extBitMap
private

Definition at line 73 of file L1TExtCondProducer.cc.

unsigned long long L1TExtCondProducer::m_l1GtMenuCacheID
private

Definition at line 72 of file L1TExtCondProducer.cc.

Referenced by L1TExtCondProducer().

bool L1TExtCondProducer::setBptxAND_
private

Definition at line 67 of file L1TExtCondProducer.cc.

bool L1TExtCondProducer::setBptxMinus_
private

Definition at line 69 of file L1TExtCondProducer.cc.

bool L1TExtCondProducer::setBptxOR_
private

Definition at line 70 of file L1TExtCondProducer.cc.

bool L1TExtCondProducer::setBptxPlus_
private

Definition at line 68 of file L1TExtCondProducer.cc.