CMS 3D CMS Logo

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

#include <EventFilter/OnlineMetaDataRawToDigi/plugins/OnlineMetaDataRawToDigi.cc>

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

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

reco::BeamSpot getBeamSpot (const online::BeamSpot_v1 &) const
 
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 event meta-data from soft-FED 1022

Definition at line 45 of file OnlineMetaDataRawToDigi.cc.

Constructor & Destructor Documentation

◆ OnlineMetaDataRawToDigi()

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

Definition at line 59 of file OnlineMetaDataRawToDigi.cc.

59  {
60  edm::InputTag dataLabel = iConfig.getParameter<edm::InputTag>("onlineMetaDataInputLabel");
61  dataToken_ = consumes<FEDRawDataCollection>(dataLabel);
62 
63  produces<CTPPSRecord>();
64  produces<DCSRecord>();
65  produces<OnlineLuminosityRecord>();
66  produces<reco::BeamSpot>();
67 }

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

◆ ~OnlineMetaDataRawToDigi()

OnlineMetaDataRawToDigi::~OnlineMetaDataRawToDigi ( )
override

Definition at line 69 of file OnlineMetaDataRawToDigi.cc.

69 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 136 of file OnlineMetaDataRawToDigi.cc.

136  {
138  desc.add<edm::InputTag>("onlineMetaDataInputLabel", edm::InputTag("rawDataCollector"));
139  descriptions.add("onlineMetaDataRawToDigi", desc);
140 }

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

◆ getBeamSpot()

reco::BeamSpot OnlineMetaDataRawToDigi::getBeamSpot ( const online::BeamSpot_v1 beamSpot) const
private

Definition at line 114 of file OnlineMetaDataRawToDigi.cc.

114  {
116 
118  matrix(0, 0) = beamSpot.errX * beamSpot.errX;
119  matrix(1, 1) = beamSpot.errY * beamSpot.errY;
120  matrix(2, 2) = beamSpot.errZ * beamSpot.errZ;
121  matrix(3, 3) = beamSpot.errSigmaZ * beamSpot.errSigmaZ;
122  matrix(4, 4) = beamSpot.errDxdz * beamSpot.errDxdz;
123  matrix(5, 5) = beamSpot.errDydz * beamSpot.errDydz;
124  matrix(6, 6) = beamSpot.errWidthX * beamSpot.errWidthX;
125  // Note: errWidthY is not part of the CovarianceMatrix
126 
129 
130  bs.setBeamWidthY(beamSpot.widthY);
131 
132  return bs;
133 }

References pwdgSkimBPark_cfi::beamSpot, cms::cuda::bs, HcalTopologyMode::LHC, makeMuonMisalignmentScenario::matrix, and point.

Referenced by produce().

◆ produce()

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

Definition at line 76 of file OnlineMetaDataRawToDigi.cc.

76  {
77  using namespace edm;
78 
80  iEvent.getByToken(dataToken_, rawdata);
81 
83  CTPPSRecord ctppsRecord;
84  OnlineLuminosityRecord onlineLuminosityRecord;
86 
87  if (rawdata.isValid()) {
88  const FEDRawData& onlineMetaDataRaw = rawdata->FEDData(FEDNumbering::MINMetaDataSoftFEDID);
89  const unsigned char* payload = onlineMetaDataRaw.data() + FEDHeader::length;
90 
91  if (onlineMetaDataRaw.size() >= FEDHeader::length + sizeof(uint8_t)) {
92  const uint8_t version = *(reinterpret_cast<uint8_t const*>(payload));
93  if (version == 1 && onlineMetaDataRaw.size() >= FEDHeader::length + sizeof(online::Data_v1)) {
94  online::Data_v1 const* onlineMetaData = reinterpret_cast<online::Data_v1 const*>(payload);
95  dcsRecord = DCSRecord(onlineMetaData->dcs);
96  onlineLuminosityRecord = OnlineLuminosityRecord(onlineMetaData->luminosity);
97  onlineBeamSpot = getBeamSpot(onlineMetaData->beamSpot);
98  } else if (version == 2 && onlineMetaDataRaw.size() >= FEDHeader::length + sizeof(online::Data_v2)) {
99  online::Data_v2 const* onlineMetaData = reinterpret_cast<online::Data_v2 const*>(payload);
100  ctppsRecord = CTPPSRecord(onlineMetaData->ctpps);
101  dcsRecord = DCSRecord(onlineMetaData->dcs);
102  onlineLuminosityRecord = OnlineLuminosityRecord(onlineMetaData->luminosity);
103  onlineBeamSpot = getBeamSpot(onlineMetaData->beamSpot);
104  }
105  }
106  }
107 
108  iEvent.put(std::make_unique<CTPPSRecord>(ctppsRecord));
109  iEvent.put(std::make_unique<DCSRecord>(dcsRecord));
110  iEvent.put(std::make_unique<OnlineLuminosityRecord>(onlineLuminosityRecord));
111  iEvent.put(std::make_unique<reco::BeamSpot>(onlineBeamSpot));
112 }

References online::Data_v1::beamSpot, online::Data_v2::beamSpot, online::Data_v2::ctpps, FEDRawData::data(), dataToken_, online::Data_v1::dcs, online::Data_v2::dcs, DQMOffline_cff::dcsRecord, FEDRawDataCollection::FEDData(), getBeamSpot(), iEvent, edm::HandleBase::isValid(), FEDHeader::length, online::Data_v1::luminosity, online::Data_v2::luminosity, FEDNumbering::MINMetaDataSoftFEDID, BeamSpotOnline_cff::onlineBeamSpot, jets_cff::payload, FEDRawData::size(), and BeamSplash_cfg::version.

Member Data Documentation

◆ dataToken_

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

Definition at line 56 of file OnlineMetaDataRawToDigi.cc.

Referenced by OnlineMetaDataRawToDigi(), and produce().

pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
FEDNumbering::MINMetaDataSoftFEDID
Definition: FEDNumbering.h:97
makeMuonMisalignmentScenario.matrix
list matrix
Definition: makeMuonMisalignmentScenario.py:141
edm
HLT enums.
Definition: AlignableModifier.h:19
HcalTopologyMode::LHC
Definition: HcalTopologyMode.h:26
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
online::Data_v2::dcs
const DCS_v1 dcs
Definition: OnlineMetaDataRaw.h:66
DCSRecord
Class to contain DCS information from soft FED 1022.
Definition: DCSRecord.h:20
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
CTPPSRecord
Class to contain CTPPS information from soft FED 1022.
Definition: CTPPSRecord.h:20
FEDRawData
Definition: FEDRawData.h:19
online::Data_v2::beamSpot
const BeamSpot_v1 beamSpot
Definition: OnlineMetaDataRaw.h:64
cms::cuda::bs
bs
Definition: HistoContainer.h:127
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
OnlineMetaDataRawToDigi::dataToken_
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition: OnlineMetaDataRawToDigi.cc:56
reco::BeamSpot
Definition: BeamSpot.h:21
online::Data_v2::ctpps
const CTPPS_v1 ctpps
Definition: OnlineMetaDataRaw.h:65
jets_cff.payload
payload
Definition: jets_cff.py:32
BeamSpotOnline_cff.onlineBeamSpot
onlineBeamSpot
Definition: BeamSpotOnline_cff.py:7
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
online::Data_v2::luminosity
const Luminosity_v1 luminosity
Definition: OnlineMetaDataRaw.h:63
iEvent
int iEvent
Definition: GenABIO.cc:224
DQMOffline_cff.dcsRecord
dcsRecord
Definition: DQMOffline_cff.py:27
online::Data_v1
Definition: OnlineMetaDataRaw.h:54
FEDHeader::length
static const uint32_t length
Definition: FEDHeader.h:54
online::Data_v1::beamSpot
const BeamSpot_v1 beamSpot
Definition: OnlineMetaDataRaw.h:57
reco::BeamSpot::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
OnlineMetaDataRawToDigi::getBeamSpot
reco::BeamSpot getBeamSpot(const online::BeamSpot_v1 &) const
Definition: OnlineMetaDataRawToDigi.cc:114
online::Data_v1::luminosity
const Luminosity_v1 luminosity
Definition: OnlineMetaDataRaw.h:56
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
online::Data_v2
Definition: OnlineMetaDataRaw.h:61
reco::BeamSpot::Point
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
online::Data_v1::dcs
const DCS_v1 dcs
Definition: OnlineMetaDataRaw.h:58
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
edm::InputTag
Definition: InputTag.h:15
OnlineLuminosityRecord
Class to contain the online luminosity from soft FED 1022.
Definition: OnlineLuminosityRecord.h:17