CMS 3D CMS Logo

SiStripFEDDump.cc
Go to the documentation of this file.
1 #include <sstream>
2 
11 
16 
18 
19 //
20 // Class declaration
21 //
22 
24 public:
25  explicit SiStripFEDDumpPlugin(const edm::ParameterSet&);
26  ~SiStripFEDDumpPlugin() override;
27 
28 private:
29  void analyze(const edm::Event&, const edm::EventSetup&) override;
30  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
31 
32  //tag of FEDRawData collection
35  //FED ID to dump
36  unsigned int fedIdToDump_;
37 };
38 
39 //
40 // Constructors and destructor
41 //
42 
44  : rawDataTag_(iConfig.getUntrackedParameter<edm::InputTag>("RawDataTag", edm::InputTag("source", ""))),
45  fedIdToDump_(iConfig.getUntrackedParameter<unsigned int>("FEDID", 50)) {
46  rawDataToken_ = consumes<FEDRawDataCollection>(rawDataTag_);
48  edm::LogError("SiStripFEDDump") << "FED ID " << fedIdToDump_ << " is not valid. "
49  << "SiStrip FED IDs are " << uint16_t(FEDNumbering::MINSiStripFEDID) << "-"
50  << uint16_t(FEDNumbering::MAXSiStripFEDID);
51 }
52 
54 
55 //
56 // Member functions
57 //
58 
59 // ------------ method called to for each event ------------
61  //get raw data
62  edm::Handle<FEDRawDataCollection> rawDataCollectionHandle;
63  iEvent.getByToken(rawDataToken_, rawDataCollectionHandle);
64  const FEDRawDataCollection& rawDataCollection = *rawDataCollectionHandle;
65 
66  const FEDRawData& rawData = rawDataCollection.FEDData(fedIdToDump_);
67  const auto st_buffer = sistrip::preconstructCheckFEDBufferBase(rawData, false);
68  if (sistrip::FEDBufferStatusCode::SUCCESS != st_buffer) {
69  throw cms::Exception("FEDBuffer") << st_buffer;
70  }
72  std::ostringstream os;
73  os << buffer << std::endl;
74  buffer.dump(os);
75  edm::LogVerbatim("SiStripFEDDump") << os.str();
76 }
77 
79  const edm::Run& run,
80  const edm::EventSetup& eSetup) {}
81 
82 //
83 // Define as a plug-in
84 //
85 
FEDNumbering.h
MessageLogger.h
edm::Run
Definition: Run.h:45
edm::EDGetTokenT< FEDRawDataCollection >
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:162
SiStripFEDDumpPlugin::rawDataTag_
edm::InputTag rawDataTag_
Definition: SiStripFEDDump.cc:33
EDAnalyzer.h
FEDRawData.h
edm::Handle< FEDRawDataCollection >
sistrip::FEDBufferBase
Definition: SiStripFEDBufferComponents.h:643
FEDRawData
Definition: FEDRawData.h:19
SiStripFEDDumpPlugin::rawDataToken_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
Definition: SiStripFEDDump.cc:34
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
SiStripFEDBuffer.h
SiStripFEDDumpPlugin
Definition: SiStripFEDDump.cc:23
EDGetToken.h
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
DQMEDAnalyzer.h
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
SiStripFEDDumpPlugin::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: SiStripFEDDump.cc:78
FEDNumbering::MAXSiStripFEDID
Definition: FEDNumbering.h:30
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
SiStripFEDDumpPlugin::fedIdToDump_
unsigned int fedIdToDump_
Definition: SiStripFEDDump.cc:36
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
sistrip::FEDBufferStatusCode::SUCCESS
FEDRawDataCollection.h
SiStripFEDDumpPlugin::SiStripFEDDumpPlugin
SiStripFEDDumpPlugin(const edm::ParameterSet &)
Definition: SiStripFEDDump.cc:43
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
InputTag.h
sistrip::preconstructCheckFEDBufferBase
FEDBufferStatusCode preconstructCheckFEDBufferBase(const FEDRawData &fedBuffer, bool checkRecognizedFormat=true)
Definition: SiStripFEDBufferComponents.h:757
SiStripFEDDumpPlugin::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: SiStripFEDDump.cc:60
writedatasetfile.run
run
Definition: writedatasetfile.py:27
Frameworkfwd.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Exception
Definition: hltDiff.cc:245
EventSetup.h
SiStripFEDDumpPlugin::~SiStripFEDDumpPlugin
~SiStripFEDDumpPlugin() override
Definition: SiStripFEDDump.cc:53
dqm::implementation::IBooker
Definition: DQMStore.h:43
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
FEDNumbering::MINSiStripFEDID
Definition: FEDNumbering.h:29