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);
79 CastorEventProduct->setBinLabel(1,
"FEDs/3");
80 CastorEventProduct->setBinLabel(2,
"RawData");
81 CastorEventProduct->setBinLabel(3,
"Digi");
82 CastorEventProduct->setBinLabel(4,
"RecHits");
83 CastorEventProduct->setBinLabel(5,
"Towers");
84 CastorEventProduct->setBinLabel(6,
"Jets");
86 sprintf(s,
"CASTORUnpackReport");
87 hunpkrep = ibooker.
bookProfile(s, s, 6, -0.5, 5.5, 100, 0, 1.e10,
"");
89 hunpkrep->setBinLabel(2,
"SPIGOT_Err");
90 hunpkrep->setBinLabel(3,
"empty");
91 hunpkrep->setBinLabel(4,
"busy");
92 hunpkrep->setBinLabel(5,
"OvF");
93 hunpkrep->setBinLabel(6,
"BadDigis");
105 LogPrint(
"CastorMonitorModule") <<
"analyze (start)";
111 bool rechitOK_ =
true, towerOK_ =
true, jetsOK_ =
true;
112 int nDigi = 0, nrecHits = 0,
nTowers = 0, nJets = 0;
115 iEvent.
getByToken(tokenTriggerResults, TrigResults);
122 float fedsUnpacked = 0.;
128 const std::vector<int>
feds = (*report).getFedsUnpacked();
129 fedsUnpacked =
float(feds.size());
130 hunpkrep->Fill(0, fedsUnpacked);
139 iEvent.
getByToken(inputTokenDigi_, CastorDigi);
141 nDigi = CastorDigi->
size();
146 iEvent.
getByToken(inputTokenRecHitCASTOR_, CastorHits);
148 nrecHits = CastorHits->
size();
153 iEvent.
getByToken(inputTokenCastorTowers_, castorTowers);
155 nTowers = castorTowers->size();
162 nJets = jets->size();
167 LogPrint(
"CastorMonitorModule") <<
"CastorProductValid(size): RawDataValid=" << RawData.
isValid()
168 <<
" Digi=" << digiOK_ <<
"(" << nDigi <<
") Hits=" << rechitOK_ <<
"(" << nrecHits
170 <<
" Towers=" << towerOK_ <<
"(" <<
nTowers <<
")" 171 <<
" Jets=" << jetsOK_ <<
"(" << nJets <<
")";
173 CastorEventProduct->Fill(0, fedsUnpacked / 3.);
174 CastorEventProduct->Fill(1, rawOK_);
175 CastorEventProduct->Fill(2, digiOK_);
176 CastorEventProduct->Fill(3, rechitOK_);
177 CastorEventProduct->Fill(4, towerOK_);
178 CastorEventProduct->Fill(5, jetsOK_);
184 DigiMon_->processEvent(iEvent, *CastorDigi, *TrigResults, *conditions);
188 if (DigiMon_ !=
nullptr)
189 std::cout <<
"TIMER:: DIGI MONITOR ->" << cpu_timer.cpuTime() << std::endl;
195 RecHitMon_->processEvent(*CastorHits);
198 if (RecHitMon_ !=
nullptr)
199 std::cout <<
"TIMER:: RECHIT MONITOR->" << cpu_timer.cpuTime() << std::endl;
205 RecHitMon_->processEventTowers(*castorTowers);
207 RecHitMon_->processEventJets(*jets);
209 if (fVerbosity > 0 && ievt_ % 100 == 0)
210 LogPrint(
"CastorMonitorModule") <<
"processed " << ievt_ <<
" events";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int spigotFormatErrors() const
int emptyEventSpigots() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath)
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
CastorMonitorModule(const edm::ParameterSet &ps)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
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)
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
void dqmEndRun(const edm::Run &run, const edm::EventSetup &eventSetup) override
~CastorMonitorModule() override
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)