10 dataLabel_(ps.getParameter<
edm::InputTag>(
"dataSource")),
12 emulLabel_(ps.getParameter<
edm::InputTag>(
"emulSource")),
14 triggerBlackList_(ps.getParameter<
std::vector<
std::
string> >(
"triggerBlackList")),
15 numBx_(ps.getParameter<
int>(
"numBxToMonitor")),
16 histFolder_(ps.getParameter<
std::
string>(
"histFolder")),
17 gtUtil_(new
l1t::L1TGlobalUtil(ps, consumesCollector(), *this, ps.getParameter<
edm::InputTag>(
"dataSource"), ps.getParameter<
edm::InputTag>(
"dataSource"))),
27 <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: " 28 <<
numBx_ <<
"\n The number must be an odd number!\n" 35 <<
"\t" <<
"Min BX= " <<
firstBx <<
"\t" <<
"Max BX= " <<
lastBx << std::endl;
54 if (!dataCollection.
isValid()) {
55 edm::LogError(
"L1TdeStage2uGT") <<
"Cannot find unpacked uGT readout record.";
58 if (!emulCollection.
isValid()) {
59 edm::LogError(
"L1TdeStage2uGT") <<
"Cannot find emulated uGT readout record.";
70 int lumi =
event.luminosityBlock();
98 hsummary=
"dataEmulSummary_" + bxt.str();
100 std::vector<GlobalAlgBlk>::const_iterator it_data, it_emul;
101 for (it_data = dataCollection->
begin(ibx), it_emul = emulCollection->
begin(ibx);
102 it_data != dataCollection->
end(ibx) && it_emul != emulCollection->
end(ibx);
103 ++it_data, ++it_emul) {
107 int numAlgs= it_data->getAlgoDecisionInitial().size();
108 for(
int algoBit = 0; algoBit < numAlgs; ++algoBit) {
112 if (not found)
continue;
115 bool isBlackListed(
false);
120 if (regex_match (algoName.c_str(),
regexp)) isBlackListed =
true;
122 if (algoName ==
pattern) isBlackListed =
true;
125 if (ibx !=0 && isBlackListed)
continue;
128 if(it_data->getAlgoDecisionInitial(algoBit) != it_emul->getAlgoDecisionInitial(algoBit)) {
130 if (it_data->getAlgoDecisionInitial(algoBit)){
131 hname =
"DataNoEmul_" + bxt.str();
135 hname =
"EmulatorNoData_" + bxt.str();
145 if(it_data->getAlgoDecisionFinal(algoBit) != it_emul->getAlgoDecisionFinal(algoBit)) {
146 bool unprescaled=
true;
151 edm::LogWarning(
"L1TdeStage2uGT") <<
"Could not find prescale value for algobit: " << algoBit << std::endl;
153 if (prescale != 1) unprescaled=
false;
157 if (it_data->getAlgoDecisionFinal(algoBit)){
158 hname =
"DataNoEmul_" + bxt.str();
162 hname =
"EmulatorNoData_" + bxt.str();
184 int nbins = prescales.size();
186 double xmax = nbins-0.5;
188 string hname, htitle;
193 ostringstream bxn,bxt;
197 bxn <<
" Central BX ";
205 hname =
"dataEmulSummary_" + bxt.str();
206 htitle =
"uGT Data/Emulator Mismatches --" + bxn.str();
215 hname=
"normalizationHisto";
216 htitle=
"Normalization histogram for uGT Data/Emulator Mismatches ratios";
231 hname =
"DataNoEmul_" + bxt.str();
232 htitle =
"uGT data-emul mismatch -- Data fired but not Emulator --" + bxn.str();
235 hname =
"EmulatorNoData_" + bxt.str();
236 htitle =
"uGT data-emul mismatch -- Emulator fired but not Data --" + bxn.str();
246 hname =
"DataNoEmul_" + bxt.str();
247 htitle =
"uGT data-emul mismatch -- Data fired but not Emulator --" + bxn.str();
250 hname =
"EmulatorNoData_" + bxt.str();
251 htitle =
"uGT data-emul mismatch -- Emulator fired but not Data --" + bxn.str();
263 (*it).second->
getTH1F()->GetXaxis()->SetTitle(
"Trigger Bit");
264 (*it).second->getTH1F()->GetYaxis()->SetTitle(
"Events with Initial Decision Mismatch");
273 (*it).second->getTH1F()->GetXaxis()->SetTitle(
"Trigger Bit (Unprescaled)");
274 (*it).second->getTH1F()->GetYaxis()->SetTitle(
"Events with Final Decision Mismatch");
282 std::map<std::string, MonitorElement*>::const_iterator hid = m_HistNames.find(histName);
284 if (hid==m_HistNames.end())
285 edm::LogWarning(
"L1TdeStage2uGT") <<
"%fillHist -- Could not find histogram with name: " << histName << std::endl;
287 hid->second->Fill(value,wt);
const_iterator end(int bx) const
const std::vector< std::pair< std::string, int > > & prescales()
const bool getPrescaleByBit(int &bit, int &prescale) const
void fillHist(const std::map< std::string, MonitorElement * > &, const std::string &, const Double_t &, const Double_t &)
bool is_glob(std::string const &pattern)
std::string glob2reg(std::string const &pattern)
edm::EDGetTokenT< GlobalAlgBlkBxCollection > emulSource_
edm::LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * m_normalizationHisto
void setCurrentFolder(std::string const &fullpath)
~L1TdeStage2uGT() override
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * book1D(Args &&...args)
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
l1t::L1TGlobalUtil * gtUtil_
const bool getAlgNameFromBit(int &bit, std::string &AlgName) const
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
std::map< std::string, MonitorElement * > m_SummaryHistograms
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * finalDecisionMismatches_vs_LS
std::vector< std::string > triggerBlackList_
std::map< std::string, MonitorElement * > m_HistNamesFinal
MonitorElement * initDecisionMismatches_vs_LS
L1TdeStage2uGT(const edm::ParameterSet &ps)
const_iterator begin(int bx) const
void retrieveL1Setup(const edm::EventSetup &evSetup)
std::map< std::string, MonitorElement * > m_HistNamesInitial
edm::EDGetTokenT< GlobalAlgBlkBxCollection > dataSource_
void retrieveL1(const edm::Event &iEvent, const edm::EventSetup &evSetup)
initialize the class (mainly reserve)