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<>

Public Member Functions

 HcalTTPTriggerRecord (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ~HcalTTPTriggerRecord () 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
 

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
 

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_.

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

Definition at line 17 of file HcalTTPTriggerRecord.cc.

17 {}

Member Function Documentation

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

Definition at line 19 of file HcalTTPTriggerRecord.cc.

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

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

Member Data Documentation

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

Definition at line 20 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().

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

Definition at line 18 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().

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

Definition at line 19 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().