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.

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

53  {
54  edm::InputTag dataLabel = iConfig.getParameter<edm::InputTag>("InputLabel");
55  dataToken_ = consumes<FEDRawDataCollection>(dataLabel);
56  produces<TCDSRecord>("tcdsRecord").setBranchAlias("tcdsRecord");
57 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< FEDRawDataCollection > dataToken_

◆ ~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.

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

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 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 66 of file TcdsRawToDigi.cc.

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

66  {
67  using namespace edm;
68 
70  iEvent.getByToken(dataToken_, rawdata);
71 
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 }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
Class to contain information from TCDS FED.
Definition: TCDSRecord.h:19
int iEvent
Definition: GenABIO.cc:224
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24

Member Data Documentation

◆ dataToken_

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

Definition at line 50 of file TcdsRawToDigi.cc.

Referenced by produce(), and TcdsRawToDigi().