CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalTTPTriggerRecord Class Reference
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 11 of file HcalTTPTriggerRecord.cc.

Constructor & Destructor Documentation

◆ HcalTTPTriggerRecord()

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

Definition at line 24 of file HcalTTPTriggerRecord.cc.

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

24  {
25  tok_ttp_ = consumes<HcalTTPDigiCollection>(ps.getParameter<edm::InputTag>("ttpDigiCollection"));
26  ttpBits_ = ps.getParameter<std::vector<unsigned int> >("ttpBits");
27  names_ = ps.getParameter<std::vector<std::string> >("ttpBitNames");
28 
29  produces<L1GtTechnicalTriggerRecord>();
30 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< unsigned int > ttpBits_
std::vector< std::string > names_
edm::EDGetTokenT< HcalTTPDigiCollection > tok_ttp_

◆ ~HcalTTPTriggerRecord()

HcalTTPTriggerRecord::~HcalTTPTriggerRecord ( )
override

Definition at line 32 of file HcalTTPTriggerRecord.cc.

32 {}

Member Function Documentation

◆ produce()

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

Definition at line 34 of file HcalTTPTriggerRecord.cc.

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

34  {
35  std::vector<L1GtTechnicalTrigger> vecTT(ttpBits_.size());
36 
37  // Get Inputs
39  e.getByToken(tok_ttp_, ttpDigiCollection);
40 
41  if (!ttpDigiCollection.failedToGet()) {
42  const HcalTTPDigiCollection* ttpDigis = ttpDigiCollection.product();
43  uint8_t ttpResults = ttpDigis->begin()->triggerOutput();
44  bool bit8 = ttpResults & 0x1;
45  bool bit9 = ttpResults & 0x2;
46  bool bit10 = ttpResults & 0x4;
47 
48  for (unsigned int i = 0; i < ttpBits_.size(); i++) {
49  bool bitValue = false;
50  if (ttpBits_.at(i) == 8)
51  bitValue = bit8;
52  if (ttpBits_.at(i) == 9)
53  bitValue = bit9;
54  if (ttpBits_.at(i) == 10)
55  bitValue = bit10;
56  vecTT.at(i) = L1GtTechnicalTrigger(names_.at(i), ttpBits_.at(i), 0, bitValue);
57  }
58  } else {
59  vecTT.clear();
60  }
61 
62  // Put output into event
63  std::unique_ptr<L1GtTechnicalTriggerRecord> output(new L1GtTechnicalTriggerRecord());
64  output->setGtTechnicalTrigger(vecTT);
65  e.put(std::move(output));
66 }
std::vector< unsigned int > ttpBits_
std::vector< std::string > names_
const_iterator begin() const
edm::EDGetTokenT< HcalTTPDigiCollection > tok_ttp_
Definition: output.py:1
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ names_

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

Definition at line 21 of file HcalTTPTriggerRecord.cc.

Referenced by HcalTTPTriggerRecord(), and produce().

◆ tok_ttp_

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

Definition at line 19 of file HcalTTPTriggerRecord.cc.

Referenced by HcalTTPTriggerRecord(), and produce().

◆ ttpBits_

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

Definition at line 20 of file HcalTTPTriggerRecord.cc.

Referenced by HcalTTPTriggerRecord(), and produce().