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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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::HcalTTPTriggerRecord ( const edm::ParameterSet ps)
explicit

Definition at line 8 of file HcalTTPTriggerRecord.cc.

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

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

◆ ~HcalTTPTriggerRecord()

HcalTTPTriggerRecord::~HcalTTPTriggerRecord ( )
override

Definition at line 16 of file HcalTTPTriggerRecord.cc.

16 {}

Member Function Documentation

◆ produce()

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

Definition at line 18 of file HcalTTPTriggerRecord.cc.

18  {
19  std::vector<L1GtTechnicalTrigger> vecTT(ttpBits_.size());
20 
21  // Get Inputs
23  e.getByToken(tok_ttp_, ttpDigiCollection);
24 
25  if (!ttpDigiCollection.failedToGet()) {
26  const HcalTTPDigiCollection* ttpDigis = ttpDigiCollection.product();
27  uint8_t ttpResults = ttpDigis->begin()->triggerOutput();
28  bool bit8 = ttpResults & 0x1;
29  bool bit9 = ttpResults & 0x2;
30  bool bit10 = ttpResults & 0x4;
31 
32  for (unsigned int i = 0; i < ttpBits_.size(); i++) {
33  bool bitValue = false;
34  if (ttpBits_.at(i) == 8)
35  bitValue = bit8;
36  if (ttpBits_.at(i) == 9)
37  bitValue = bit9;
38  if (ttpBits_.at(i) == 10)
39  bitValue = bit10;
40  vecTT.at(i) = L1GtTechnicalTrigger(names_.at(i), ttpBits_.at(i), 0, bitValue);
41  }
42  } else {
43  vecTT.clear();
44  }
45 
46  // Put output into event
47  std::unique_ptr<L1GtTechnicalTriggerRecord> output(new L1GtTechnicalTriggerRecord());
48  output->setGtTechnicalTrigger(vecTT);
49  e.put(std::move(output));
50 }

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.

Member Data Documentation

◆ names_

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

Definition at line 20 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().

◆ tok_ttp_

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

Definition at line 18 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().

◆ ttpBits_

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

Definition at line 19 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().

mps_fire.i
i
Definition: mps_fire.py:428
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
L1GtTechnicalTrigger
Definition: L1GtTechnicalTrigger.h:33
edm::SortedCollection
Definition: SortedCollection.h:49
edm::Handle
Definition: AssociativeIterator.h:50
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
HcalTTPTriggerRecord::names_
std::vector< std::string > names_
Definition: HcalTTPTriggerRecord.h:20
HcalTTPTriggerRecord::tok_ttp_
edm::EDGetTokenT< HcalTTPDigiCollection > tok_ttp_
Definition: HcalTTPTriggerRecord.h:18
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1GtTechnicalTriggerRecord
Definition: L1GtTechnicalTriggerRecord.h:28
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag
Definition: InputTag.h:15
HcalTTPTriggerRecord::ttpBits_
std::vector< unsigned int > ttpBits_
Definition: HcalTTPTriggerRecord.h:19
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
SimL1EmulatorDM_cff.ttpDigiCollection
ttpDigiCollection
Definition: SimL1EmulatorDM_cff.py:16