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

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

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

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< FEDRawDataCollection > dataToken_

◆ ~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 142 of file OnlineMetaDataRawToDigi.cc.

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

142  {
144  desc.add<edm::InputTag>("onlineMetaDataInputLabel", edm::InputTag("rawDataCollector"));
145  descriptions.add("onlineMetaDataRawToDigi", desc);
146 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ getBeamSpot()

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

Definition at line 120 of file OnlineMetaDataRawToDigi.cc.

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

Referenced by produce().

120  {
122 
124  matrix(0, 0) = beamSpot.errX * beamSpot.errX;
125  matrix(1, 1) = beamSpot.errY * beamSpot.errY;
126  matrix(2, 2) = beamSpot.errZ * beamSpot.errZ;
127  matrix(3, 3) = beamSpot.errSigmaZ * beamSpot.errSigmaZ;
128  matrix(4, 4) = beamSpot.errDxdz * beamSpot.errDxdz;
129  matrix(5, 5) = beamSpot.errDydz * beamSpot.errDydz;
130  matrix(6, 6) = beamSpot.errWidthX * beamSpot.errWidthX;
131  // Note: errWidthY is not part of the CovarianceMatrix
132 
135 
136  bs.setBeamWidthY(beamSpot.widthY);
137 
138  return bs;
139 }
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
*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

◆ produce()

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

Definition at line 76 of file OnlineMetaDataRawToDigi.cc.

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

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  } else if (version == 3 && onlineMetaDataRaw.size() >= FEDHeader::length + sizeof(online::Data_v3)) {
105  online::Data_v3 const* onlineMetaData = reinterpret_cast<online::Data_v3 const*>(payload);
106  ctppsRecord = CTPPSRecord(onlineMetaData->ctpps);
107  dcsRecord = DCSRecord(onlineMetaData->dcs);
108  onlineLuminosityRecord = OnlineLuminosityRecord(onlineMetaData->luminosity);
109  onlineBeamSpot = getBeamSpot(onlineMetaData->beamSpot);
110  }
111  }
112  }
113 
114  iEvent.put(std::make_unique<CTPPSRecord>(ctppsRecord));
115  iEvent.put(std::make_unique<DCSRecord>(dcsRecord));
116  iEvent.put(std::make_unique<OnlineLuminosityRecord>(onlineLuminosityRecord));
117  iEvent.put(std::make_unique<reco::BeamSpot>(onlineBeamSpot));
118 }
const Luminosity_v1 luminosity
static const uint32_t length
Definition: FEDHeader.h:54
Class to contain the online luminosity from soft FED 1022.
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
Class to contain DCS information from soft FED 1022.
Definition: DCSRecord.h:20
const Luminosity_v1 luminosity
int iEvent
Definition: GenABIO.cc:224
const CTPPS_v1 ctpps
reco::BeamSpot getBeamSpot(const online::BeamSpot_v1 &) const
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
const BeamSpot_v1 beamSpot
const Luminosity_v1 luminosity
const BeamSpot_v1 beamSpot
const DCS_v1 dcs
bool isValid() const
Definition: HandleBase.h:70
Class to contain CTPPS information from soft FED 1022.
Definition: CTPPSRecord.h:20
const DCS_v1 dcs
HLT enums.
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
const BeamSpot_v1 beamSpot
const DCS_v2 dcs
const CTPPS_v1 ctpps

Member Data Documentation

◆ dataToken_

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

Definition at line 56 of file OnlineMetaDataRawToDigi.cc.

Referenced by OnlineMetaDataRawToDigi(), and produce().