CMS 3D CMS Logo

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

#include <ProdTutorial/TcdsRawToDigi/plugins/TcdsRawToDigi.cc>

Inheritance diagram for TcdsRawToDigi:
edm::stream::EDProducer<>

Public Member Functions

 TcdsRawToDigi (const edm::ParameterSet &)
 
 ~TcdsRawToDigi () 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< FEDRawDataCollectiondataToken_
 

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

Description: Producer to unpack lumi nibble from TCDS

Definition at line 40 of file TcdsRawToDigi.cc.

Constructor & Destructor Documentation

◆ TcdsRawToDigi()

TcdsRawToDigi::TcdsRawToDigi ( const edm::ParameterSet iConfig)
explicit

Definition at line 53 of file TcdsRawToDigi.cc.

53  {
54  edm::InputTag dataLabel = iConfig.getParameter<edm::InputTag>("InputLabel");
55  dataToken_ = consumes<FEDRawDataCollection>(dataLabel);
56  produces<TCDSRecord>("tcdsRecord").setBranchAlias("tcdsRecord");
57 }

References dataToken_, and edm::ParameterSet::getParameter().

◆ ~TcdsRawToDigi()

TcdsRawToDigi::~TcdsRawToDigi ( )
override

Definition at line 59 of file TcdsRawToDigi.cc.

59 {}

Member Function Documentation

◆ fillDescriptions()

void TcdsRawToDigi::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 90 of file TcdsRawToDigi.cc.

90  {
91  //The following says we do not know what parameters are allowed so do no validation
92  // Please change this to state exactly what you do use, even if it is no parameters
94  desc.add<edm::InputTag>("InputLabel", edm::InputTag("rawDataCollector"));
95  descriptions.add("tcdsRawToDigi", desc);
96 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

◆ produce()

void TcdsRawToDigi::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 66 of file TcdsRawToDigi.cc.

66  {
67  using namespace edm;
68 
70  iEvent.getByToken(dataToken_, rawdata);
71 
72  TCDSRecord tcdsRecord;
73  if (rawdata.isValid()) {
74  uint16_t selectedId = 0;
76  const FEDRawData& tcdsData = rawdata->FEDData(fedId);
77  if (tcdsData.size() > 0) {
78  if (selectedId)
79  throw cms::Exception("TcdsRawToDigi::produce")
80  << "Second TCDS FED ID " << fedId << " found. First ID: " << selectedId;
81  tcdsRecord = TCDSRecord(tcdsData.data());
82  selectedId = fedId;
83  }
84  }
85  }
86  iEvent.put(std::make_unique<TCDSRecord>(tcdsRecord), "tcdsRecord");
87 }

References FEDRawData::data(), dataToken_, Exception, FEDRawDataCollection::FEDData(), l1tstage2_dqm_sourceclient-live_cfg::fedId, iEvent, edm::HandleBase::isValid(), FEDNumbering::MAXTCDSuTCAFEDID, FEDNumbering::MINTCDSuTCAFEDID, and FEDRawData::size().

Member Data Documentation

◆ dataToken_

edm::EDGetTokenT<FEDRawDataCollection> TcdsRawToDigi::dataToken_
private

Definition at line 50 of file TcdsRawToDigi.cc.

Referenced by produce(), and TcdsRawToDigi().

edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle< FEDRawDataCollection >
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
TcdsRawToDigi::dataToken_
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition: TcdsRawToDigi.cc:50
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
FEDNumbering::MAXTCDSuTCAFEDID
Definition: FEDNumbering.h:102
FEDNumbering::MINTCDSuTCAFEDID
Definition: FEDNumbering.h:101
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
iEvent
int iEvent
Definition: GenABIO.cc:224
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:89
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
TCDSRecord
Class to contain information from TCDS FED.
Definition: TCDSRecord.h:19
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15