CMS 3D CMS Logo

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
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 172 of file L1TExtCondProducer.cc.

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

172  {
173  // simGtExtFakeProd
175  desc.add<bool>("setBptxMinus", true);
176  desc.add<bool>("setBptxAND", true);
177  desc.add<int>("bxFirst", -2);
178  desc.add<bool>("setBptxOR", true);
179  desc.add<int>("bxLast", 2);
180  desc.add<bool>("setBptxPlus", true);
181  descriptions.add("simGtExtFakeProd", desc);
182  }
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

Definition at line 107 of file L1TExtCondProducer.cc.

References bxFirst_, bxLast_, edm::EventSetup::get(), l1t::TriggerMenuParser::getExternalSignals(), LogDebug, m_extBitMap, m_l1GtMenuCacheID, eostools::move(), edm::ESHandle< T >::product(), edm::Event::put(), setBptxAND_, setBptxMinus_, setBptxOR_, setBptxPlus_, 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
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::unique_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  //check for updated Bptx names as well
149  foundBptxAND = ( m_extBitMap.find("ZeroBias_BPTX_AND_VME")!=m_extBitMap.end() );
150  foundBptxPlus = ( m_extBitMap.find("BPTX_B1_VME")!=m_extBitMap.end() );
151  foundBptxMinus = ( m_extBitMap.find("BPTX_B2_VME")!=m_extBitMap.end() );
152  foundBptxOR = ( m_extBitMap.find("BPTX_OR_VME")!=m_extBitMap.end() );
153 
154  // Fill in some external conditions for testing
155  if( setBptxAND_ && foundBptxAND ) extCond_bx.setExternalDecision(m_extBitMap["ZeroBias_BPTX_AND_VME"],true);
156  if( setBptxPlus_ && foundBptxPlus ) extCond_bx.setExternalDecision(m_extBitMap["BPTX_B1_VME"],true);
157  if( setBptxMinus_ && foundBptxMinus ) extCond_bx.setExternalDecision(m_extBitMap["BPTX_B2_VME"],true);
158  if( setBptxOR_ && foundBptxOR ) extCond_bx.setExternalDecision(m_extBitMap["BPTX_OR_VME"],true);
159 
160  // Fill Externals
161  for( int iBx=bxFirst_; iBx<=bxLast_; iBx++ ){
162  extCond->push_back(iBx, extCond_bx);
163  }
164 
165 
166  iEvent.put(std::move(extCond));
167 
168  }
#define LogDebug(id)
BXVector< GlobalExtBlk > GlobalExtBlkBxCollection
Definition: GlobalExtBlk.h:30
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
std::map< std::string, unsigned int > getExternalSignals(const L1TUtmTriggerMenu *utmMenu)
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:55
std::map< std::string, unsigned int > m_extBitMap
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

int L1TExtCondProducer::bxFirst_
private

Definition at line 64 of file L1TExtCondProducer.cc.

Referenced by produce().

int L1TExtCondProducer::bxLast_
private

Definition at line 65 of file L1TExtCondProducer.cc.

Referenced by produce().

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

Definition at line 73 of file L1TExtCondProducer.cc.

Referenced by produce().

unsigned long long L1TExtCondProducer::m_l1GtMenuCacheID
private

Definition at line 72 of file L1TExtCondProducer.cc.

Referenced by L1TExtCondProducer(), and produce().

bool L1TExtCondProducer::setBptxAND_
private

Definition at line 67 of file L1TExtCondProducer.cc.

Referenced by produce().

bool L1TExtCondProducer::setBptxMinus_
private

Definition at line 69 of file L1TExtCondProducer.cc.

Referenced by produce().

bool L1TExtCondProducer::setBptxOR_
private

Definition at line 70 of file L1TExtCondProducer.cc.

Referenced by produce().

bool L1TExtCondProducer::setBptxPlus_
private

Definition at line 68 of file L1TExtCondProducer.cc.

Referenced by produce().