CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< FEDRawDataCollection
dataToken_
 

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

Definition at line 69 of file OnlineMetaDataRawToDigi.cc.

69 {}

Member Function Documentation

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

Definition at line 142 of file OnlineMetaDataRawToDigi.cc.

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

142  {
144  desc.add<edm::InputTag>("onlineMetaDataInputLabel", edm::InputTag("rawDataCollector"));
145  descriptions.add("onlineMetaDataRawToDigi", desc);
146 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
reco::BeamSpot OnlineMetaDataRawToDigi::getBeamSpot ( const online::BeamSpot_v1 beamSpot) const
private

Definition at line 120 of file OnlineMetaDataRawToDigi.cc.

References cms::cuda::bs, online::BeamSpot_v1::dxdz, online::BeamSpot_v1::dydz, online::BeamSpot_v1::errDxdz, online::BeamSpot_v1::errDydz, online::BeamSpot_v1::errSigmaZ, online::BeamSpot_v1::errWidthX, online::BeamSpot_v1::errX, online::BeamSpot_v1::errY, online::BeamSpot_v1::errZ, HcalTopologyMode::LHC, makeMuonMisalignmentScenario::matrix, point, reco::BeamSpot::setBeamWidthY(), online::BeamSpot_v1::sigmaZ, online::BeamSpot_v1::widthX, online::BeamSpot_v1::widthY, online::BeamSpot_v1::x, online::BeamSpot_v1::y, and online::BeamSpot_v1::z.

Referenced by produce().

120  {
121  reco::BeamSpot::Point point(beamSpot.x, beamSpot.y, beamSpot.z);
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 
134  point, beamSpot.sigmaZ, beamSpot.dxdz, beamSpot.dydz, beamSpot.widthX, matrix, reco::BeamSpot::BeamType::LHC);
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
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, getBeamSpot(), edm::Event::getByToken(), FEDHeader::length, online::Data_v1::luminosity, online::Data_v2::luminosity, online::Data_v3::luminosity, FEDNumbering::MINMetaDataSoftFEDID, BeamSpotOnline_cff::onlineBeamSpot, jetCorrFactors_cfi::payload, edm::Event::put(), FEDRawData::size(), and relval_steps::version.

76  {
77  using namespace edm;
78 
80  iEvent.getByToken(dataToken_, rawdata);
81 
82  DCSRecord dcsRecord;
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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const Luminosity_v1 luminosity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
static const uint32_t length
Definition: FEDHeader.h:54
Class to contain the online luminosity from soft FED 1022.
Class to contain DCS information from soft FED 1022.
Definition: DCSRecord.h:20
const Luminosity_v1 luminosity
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
const CTPPS_v1 ctpps
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
reco::BeamSpot getBeamSpot(const online::BeamSpot_v1 &) const
const BeamSpot_v1 beamSpot
const Luminosity_v1 luminosity
const BeamSpot_v1 beamSpot
const DCS_v1 dcs
Class to contain CTPPS information from soft FED 1022.
Definition: CTPPSRecord.h:20
const DCS_v1 dcs
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

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

Definition at line 56 of file OnlineMetaDataRawToDigi.cc.

Referenced by OnlineMetaDataRawToDigi(), and produce().