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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 48 of file OnlineMetaDataRawToDigi.cc.

Constructor & Destructor Documentation

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

Definition at line 62 of file OnlineMetaDataRawToDigi.cc.

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

63 {
64  edm::InputTag dataLabel = iConfig.getParameter<edm::InputTag>("onlineMetaDataInputLabel");
65  dataToken_=consumes<FEDRawDataCollection>(dataLabel);
66 
67  produces<CTPPSRecord>();
68  produces<DCSRecord>();
69  produces<OnlineLuminosityRecord>();
70  produces<reco::BeamSpot>();
71 }
T getParameter(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
OnlineMetaDataRawToDigi::~OnlineMetaDataRawToDigi ( )
override

Definition at line 74 of file OnlineMetaDataRawToDigi.cc.

74 {}

Member Function Documentation

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

Definition at line 152 of file OnlineMetaDataRawToDigi.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and DEFINE_FWK_MODULE.

152  {
154  desc.add<edm::InputTag>("onlineMetaDataInputLabel",edm::InputTag("rawDataCollector"));
155  descriptions.add("onlineMetaDataRawToDigi", desc);
156 }
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 123 of file OnlineMetaDataRawToDigi.cc.

References 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().

124 {
125  reco::BeamSpot::Point point(beamSpot.x,beamSpot.y,beamSpot.z);
126 
128  matrix(0,0) = beamSpot.errX*beamSpot.errX;
129  matrix(1,1) = beamSpot.errY*beamSpot.errY;
130  matrix(2,2) = beamSpot.errZ*beamSpot.errZ;
131  matrix(3,3) = beamSpot.errSigmaZ*beamSpot.errSigmaZ;
132  matrix(4,4) = beamSpot.errDxdz*beamSpot.errDxdz;
133  matrix(5,5) = beamSpot.errDydz*beamSpot.errDydz;
134  matrix(6,6) = beamSpot.errWidthX*beamSpot.errWidthX;
135  // Note: errWidthY is not part of the CovarianceMatrix
136 
138  beamSpot.sigmaZ,
139  beamSpot.dxdz,
140  beamSpot.dydz,
141  beamSpot.widthX,
142  matrix,
144 
145  bs.setBeamWidthY(beamSpot.widthY);
146 
147  return bs;
148 }
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:31
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:29
*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 82 of file OnlineMetaDataRawToDigi.cc.

References online::Data_v1::beamSpot, online::Data_v2::beamSpot, online::Data_v2::ctpps, FEDRawData::data(), dataToken_, online::Data_v1::dcs, online::Data_v2::dcs, FEDRawDataCollection::FEDData(), getBeamSpot(), edm::Event::getByToken(), edm::HandleBase::isValid(), FEDHeader::length, online::Data_v1::luminosity, online::Data_v2::luminosity, FEDNumbering::MINMetaDataSoftFEDID, BeamSpotOnline_cff::onlineBeamSpot, jets_cff::payload, edm::Event::put(), matplotRender::rawdata, FEDRawData::size(), and jets_cff::version.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

83 {
84  using namespace edm;
85 
87  iEvent.getByToken(dataToken_,rawdata);
88 
89  DCSRecord dcsRecord;
90  CTPPSRecord ctppsRecord;
91  OnlineLuminosityRecord onlineLuminosityRecord;
93 
94  if( rawdata.isValid() ) {
95  const FEDRawData& onlineMetaDataRaw = rawdata->FEDData(FEDNumbering::MINMetaDataSoftFEDID);
96  const unsigned char* payload = onlineMetaDataRaw.data() + FEDHeader::length;
97 
98  if ( onlineMetaDataRaw.size() >= FEDHeader::length + sizeof(uint8_t) ) {
99  const uint8_t version = *(reinterpret_cast<uint8_t const*>(payload));
100  if ( version == 1 && onlineMetaDataRaw.size() >= FEDHeader::length + sizeof(online::Data_v1) ) {
101  online::Data_v1 const* onlineMetaData = reinterpret_cast<online::Data_v1 const*>(payload);
102  dcsRecord = DCSRecord(onlineMetaData->dcs);
103  onlineLuminosityRecord = OnlineLuminosityRecord(onlineMetaData->luminosity);
104  onlineBeamSpot = getBeamSpot(onlineMetaData->beamSpot);
105  }
106  else if ( version == 2 && onlineMetaDataRaw.size() >= FEDHeader::length + sizeof(online::Data_v2) ) {
107  online::Data_v2 const* onlineMetaData = reinterpret_cast<online::Data_v2 const*>(payload);
108  ctppsRecord = CTPPSRecord(onlineMetaData->ctpps);
109  dcsRecord = DCSRecord(onlineMetaData->dcs);
110  onlineLuminosityRecord = OnlineLuminosityRecord(onlineMetaData->luminosity);
111  onlineBeamSpot = getBeamSpot(onlineMetaData->beamSpot);
112  }
113  }
114  }
115 
116  iEvent.put(std::make_unique<CTPPSRecord>(ctppsRecord));
117  iEvent.put(std::make_unique<DCSRecord>(dcsRecord));
118  iEvent.put(std::make_unique<OnlineLuminosityRecord>(onlineLuminosityRecord));
119  iEvent.put(std::make_unique<reco::BeamSpot>(onlineBeamSpot));
120 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
const Luminosity_v1 luminosity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
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:22
const Luminosity_v1 luminosity
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
const CTPPS_v1 ctpps
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
bool isValid() const
Definition: HandleBase.h:74
reco::BeamSpot getBeamSpot(const online::BeamSpot_v1 &) const
const BeamSpot_v1 beamSpot
const DCS_v1 dcs
Class to contain CTPPS information from soft FED 1022.
Definition: CTPPSRecord.h:22
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:28
const BeamSpot_v1 beamSpot

Member Data Documentation

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

Definition at line 59 of file OnlineMetaDataRawToDigi.cc.

Referenced by OnlineMetaDataRawToDigi(), and produce().