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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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

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(), edm::ParameterSetDescription::add(), and HLT_2018_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().

FEDNumbering::MAXTCDSuTCAFEDID
Definition: FEDNumbering.h:102
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
FEDNumbering::MINTCDSuTCAFEDID
Definition: FEDNumbering.h:101
edm::Handle
Definition: AssociativeIterator.h:50
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
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
iEvent
int iEvent
Definition: GenABIO.cc:224
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TCDSRecord
Class to contain information from TCDS FED.
Definition: TCDSRecord.h:19
Exception
Definition: hltDiff.cc:246
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15