CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalTTPTriggerRecord Class Reference

#include <HcalTTPTriggerRecord.h>

Inheritance diagram for HcalTTPTriggerRecord:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HcalTTPTriggerRecord (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~HcalTTPTriggerRecord ()
 
- 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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > 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)
 

Private Attributes

std::vector< std::string > names_
 
edm::EDGetTokenT< HcalTTPDigiCollectiontok_ttp_
 
std::vector< unsigned int > ttpBits_
 

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
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 10 of file HcalTTPTriggerRecord.h.

Constructor & Destructor Documentation

HcalTTPTriggerRecord::HcalTTPTriggerRecord ( const edm::ParameterSet ps)
explicit

Definition at line 9 of file HcalTTPTriggerRecord.cc.

References edm::ParameterSet::getParameter(), names_, tok_ttp_, and ttpBits_.

10 {
11  tok_ttp_ = consumes<HcalTTPDigiCollection>(ps.getParameter<edm::InputTag>("ttpDigiCollection"));
12  ttpBits_ = ps.getParameter< std::vector<unsigned int> >("ttpBits");
13  names_ = ps.getParameter< std::vector<std::string> >("ttpBitNames");
14 
15  produces<L1GtTechnicalTriggerRecord>();
16 }
T getParameter(std::string const &) const
std::vector< unsigned int > ttpBits_
std::vector< std::string > names_
edm::EDGetTokenT< HcalTTPDigiCollection > tok_ttp_
HcalTTPTriggerRecord::~HcalTTPTriggerRecord ( )
virtual

Definition at line 19 of file HcalTTPTriggerRecord.cc.

19  {
20 }

Member Function Documentation

void HcalTTPTriggerRecord::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Definition at line 22 of file HcalTTPTriggerRecord.cc.

References edm::SortedCollection< T, SORT >::begin(), funct::false, edm::Event::getByToken(), mps_fire::i, eostools::move(), names_, convertSQLitetoXML_cfg::output, edm::Event::put(), tok_ttp_, ttpBits_, and hcalTTPRecord_cfi::ttpDigiCollection.

22  {
23 
24  std::vector<L1GtTechnicalTrigger> vecTT(ttpBits_.size()) ;
25 
26  // Get Inputs
28  e.getByToken(tok_ttp_,ttpDigiCollection) ;
29 
30  if ( !ttpDigiCollection.failedToGet() ) {
31  const HcalTTPDigiCollection* ttpDigis = ttpDigiCollection.product() ;
32  uint8_t ttpResults = ttpDigis->begin()->triggerOutput() ;
33  bool bit8 = ttpResults & 0x1 ;
34  bool bit9 = ttpResults & 0x2 ;
35  bool bit10 = ttpResults & 0x4 ;
36 
37  for (unsigned int i=0; i<ttpBits_.size(); i++) {
38  bool bitValue = false ;
39  if ( ttpBits_.at(i) == 8 ) bitValue = bit8 ;
40  if ( ttpBits_.at(i) == 9 ) bitValue = bit9 ;
41  if ( ttpBits_.at(i) == 10 ) bitValue = bit10 ;
42  vecTT.at(i) = L1GtTechnicalTrigger(names_.at(i), ttpBits_.at(i), 0, bitValue) ;
43  }
44  } else {
45  vecTT.clear() ;
46  }
47 
48  // Put output into event
49  std::unique_ptr<L1GtTechnicalTriggerRecord> output(new L1GtTechnicalTriggerRecord()) ;
50  output->setGtTechnicalTrigger(vecTT) ;
51  e.put(std::move(output)) ;
52 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::vector< unsigned int > ttpBits_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::vector< std::string > names_
edm::EDGetTokenT< HcalTTPDigiCollection > tok_ttp_
def move(src, dest)
Definition: eostools.py:510
const_iterator begin() const

Member Data Documentation

std::vector<std::string> HcalTTPTriggerRecord::names_
private

Definition at line 23 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().

edm::EDGetTokenT<HcalTTPDigiCollection> HcalTTPTriggerRecord::tok_ttp_
private

Definition at line 21 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().

std::vector<unsigned int> HcalTTPTriggerRecord::ttpBits_
private

Definition at line 22 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().