CMS 3D CMS Logo

L1TFED.cc
Go to the documentation of this file.
1 /*
2  * \file L1TFED.cc
3  *
4  * \author J. Berryhill
5  *
6  */
7 
9 
10 using namespace std;
11 using namespace edm;
12 
14  // verbosity switch
15  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
16  l1feds_ = ps.getParameter<std::vector<int> >("L1FEDS");
17  directory_ = ps.getUntrackedParameter<std::string>("FEDDirName", "L1T/FEDIntegrity");
18  stableROConfig_ = ps.getUntrackedParameter<bool>("stableROConfig", true);
19  rawl_ = consumes<FEDRawDataCollection>(ps.getParameter<InputTag>("rawTag"));
20 
21  if (verbose_)
22  cout << "L1TFED: constructor...." << endl;
23  nev_ = 0;
24 }
25 
27 
28 void L1TFED::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) {
29  ibooker.setCurrentFolder(directory_);
30 
31  fedentries = ibooker.book1D("FEDEntries", "Fed ID occupancy", l1feds_.size(), 0., l1feds_.size());
32  fedfatal = ibooker.book1D("FEDFatal", "Fed ID non present ", l1feds_.size(), 0., l1feds_.size());
33  fednonfatal = ibooker.book1D("FEDNonFatal", "Fed corrupted data ", l1feds_.size(), 0., l1feds_.size());
34  hfedprof = ibooker.bookProfile("fedprofile", "FED Size by ID", l1feds_.size(), 0., l1feds_.size(), 0, 0., 10000.);
35  for (unsigned int i = 0; i < l1feds_.size(); i++) {
36  ostringstream sfed;
37  sfed << l1feds_[i];
38  fedentries->setBinLabel(i + 1, "FED " + sfed.str());
39  fedfatal->setBinLabel(i + 1, "FED " + sfed.str());
40  fednonfatal->setBinLabel(i + 1, "FED " + sfed.str());
41  hfedprof->setBinLabel(i + 1, "FED " + sfed.str());
42  }
43 
44  hfedsize = ibooker.book1D("fedsize", "FED Size Distribution", 100, 0., 10000.);
45 }
46 
47 void L1TFED::analyze(const Event& e, const EventSetup& c) {
48  nev_++;
49  if (verbose_)
50  cout << "L1T FED Integrity: analyze...." << endl;
51 
53  bool t = e.getByToken(rawl_, rawdata);
54 
55  if (!t) {
56  if (verbose_)
57  cout << "can't find FEDRawDataCollection " << endl;
58  }
59 
60  else {
61  if (verbose_)
62  cout << "fedlist size = " << l1feds_.size() << endl;
63 
64  for (unsigned int i = 0; i < l1feds_.size(); i++) {
65  int fedId = l1feds_[i];
66  if (verbose_)
67  cout << "fedId = " << fedId << endl;
68 
69  const FEDRawData& data = rawdata->FEDData(fedId);
70 
71  if (size_t size = data.size()) {
72  fedentries->Fill(i);
73  hfedsize->Fill(float(size));
74  hfedprof->Fill(float(i), float(size));
75  if (verbose_)
76  cout << "header check = " << FEDHeader(data.data()).check() << endl;
77  if (verbose_)
78  cout << "trailer check = " << FEDTrailer(data.data()).check() << endl;
79 
80  if (!FEDHeader(data.data()).check())
81  fedfatal->Fill(i);
82 
83  } else {
84  if (verbose_)
85  cout << "empty fed " << i << endl;
86  if (stableROConfig_)
87  fedfatal->Fill(i);
88  }
89  }
90  }
91 }
mps_fire.i
i
Definition: mps_fire.py:428
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1TFED::L1TFED
L1TFED(const edm::ParameterSet &ps)
Definition: L1TFED.cc:13
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle< FEDRawDataCollection >
FEDRawData
Definition: FEDRawData.h:19
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
dqm::implementation::IBooker::bookProfile
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
edm::ParameterSet
Definition: ParameterSet.h:47
FEDTrailer
Definition: FEDTrailer.h:14
L1TFED.h
dqm::impl::MonitorElement::setBinLabel
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:771
edm::EventSetup
Definition: EventSetup.h:58
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:89
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1TFED::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: L1TFED.cc:28
std
Definition: JetResolutionObject.h:76
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
dqm::implementation::IBooker
Definition: DQMStore.h:43
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
FEDHeader
Definition: FEDHeader.h:14
edm::Event
Definition: Event.h:73
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::InputTag
Definition: InputTag.h:15
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
L1TFED::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TFED.cc:47
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
L1TFED::~L1TFED
~L1TFED() override
Definition: L1TFED.cc:26