43 DigiMon_ = std::make_unique<CastorDigiMonitor>(ps);
46 RecHitMon_ = std::make_unique<CastorRecHitMonitor>(ps);
49 LedMon_ = std::make_unique<CastorLEDMonitor>(ps);
58 LogPrint(
"CastorMonitorModule") <<
"dqmBeginRun(start)";
65 DigiMon_->bookHistograms(ibooker, iRun, iSetup);
68 RecHitMon_->bookHistograms(ibooker, iRun, iSetup);
71 LedMon_->bookHistograms(ibooker, iRun, iSetup);
76 sprintf(s,
"CastorEventProducts");
77 CastorEventProduct = ibooker.
book1DD(s, s, 6, -0.5, 5.5);
78 CastorEventProduct->
getTH1D()->GetYaxis()->SetTitle(
"Events");
79 TAxis *xa = CastorEventProduct->getTH1D()->GetXaxis();
80 xa->SetBinLabel(1,
"FEDs/3");
81 xa->SetBinLabel(2,
"RawData");
82 xa->SetBinLabel(3,
"Digi");
83 xa->SetBinLabel(4,
"RecHits");
84 xa->SetBinLabel(5,
"Towers");
85 xa->SetBinLabel(6,
"Jets");
87 sprintf(s,
"CASTORUnpackReport");
88 hunpkrep = ibooker.
bookProfile(s, s, 6, -0.5, 5.5, 100, 0, 1.e10,
"");
90 xa->SetBinLabel(1,
"N_FEDs");
91 xa->SetBinLabel(2,
"SPIGOT_Err");
92 xa->SetBinLabel(3,
"empty");
93 xa->SetBinLabel(4,
"busy");
94 xa->SetBinLabel(5,
"OvF");
95 xa->SetBinLabel(6,
"BadDigis");
107 LogPrint(
"CastorMonitorModule") <<
"analyze (start)";
113 bool rechitOK_ =
true, towerOK_ =
true, jetsOK_ =
true;
114 int nDigi = 0, nrecHits = 0,
nTowers = 0, nJets = 0;
117 iEvent.
getByToken(tokenTriggerResults, TrigResults);
124 float fedsUnpacked = 0.;
130 const std::vector<int> feds = (*report).getFedsUnpacked();
131 fedsUnpacked =
float(feds.size());
132 hunpkrep->Fill(0, fedsUnpacked);
141 iEvent.
getByToken(inputTokenDigi_, CastorDigi);
143 nDigi = CastorDigi->
size();
148 iEvent.
getByToken(inputTokenRecHitCASTOR_, CastorHits);
150 nrecHits = CastorHits->
size();
155 iEvent.
getByToken(inputTokenCastorTowers_, castorTowers);
157 nTowers = castorTowers->size();
164 nJets = jets->size();
169 LogPrint(
"CastorMonitorModule") <<
"CastorProductValid(size): RawDataValid=" << RawData.
isValid()
170 <<
" Digi=" << digiOK_ <<
"(" << nDigi <<
") Hits=" << rechitOK_ <<
"(" << nrecHits
172 <<
" Towers=" << towerOK_ <<
"(" <<
nTowers <<
")" 173 <<
" Jets=" << jetsOK_ <<
"(" << nJets <<
")";
175 CastorEventProduct->Fill(0, fedsUnpacked / 3.);
176 CastorEventProduct->Fill(1, rawOK_);
177 CastorEventProduct->Fill(2, digiOK_);
178 CastorEventProduct->Fill(3, rechitOK_);
179 CastorEventProduct->Fill(4, towerOK_);
180 CastorEventProduct->Fill(5, jetsOK_);
186 DigiMon_->processEvent(iEvent, *CastorDigi, *TrigResults, *conditions);
190 if (DigiMon_ !=
nullptr)
191 std::cout <<
"TIMER:: DIGI MONITOR ->" << cpu_timer.cpuTime() << std::endl;
197 RecHitMon_->processEvent(*CastorHits);
200 if (RecHitMon_ !=
nullptr)
201 std::cout <<
"TIMER:: RECHIT MONITOR->" << cpu_timer.cpuTime() << std::endl;
207 RecHitMon_->processEventTowers(*castorTowers);
209 RecHitMon_->processEventJets(*jets);
211 if (fVerbosity > 0 && ievt_ % 100 == 0)
212 LogPrint(
"CastorMonitorModule") <<
"processed " << ievt_ <<
" events";
TProfile * getTProfile() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int spigotFormatErrors() const
int emptyEventSpigots() const
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void endRun(const edm::Run &run, const edm::EventSetup &eventSetup) override
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
void setCurrentFolder(std::string const &fullpath)
CastorMonitorModule(const edm::ParameterSet &ps)
int badQualityDigis() const
void analyze(const edm::Event &iEvent, const edm::EventSetup &eventSetup) override
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * book1DD(Args &&...args)
~CastorMonitorModule() override