15 using namespace trigger;
19 LogDebug(
"HLTSeedL1LogicScalers") <<
"constructor";
23 fL1BeforeMask = iConfig.
getParameter<
bool>(
"l1BeforeMask");
27 fL1GtDaqReadoutRecordInputTag =
36 "DQMFolder",
string(
"HLT/HLTSeedL1LogicScalers/HLT_LogicL1"));
47 if (!fHLTConfig.init(run, iSetup, fProcessname, changed)) {
49 <<
"HLTConfigProvider failed to initialize.";
53 const unsigned int n(fHLTConfig.size());
54 for (
unsigned int j = 0;
j !=
n; ++
j) {
55 LogTrace(
"HLTSeedL1LogicScalers") <<
"HLTConfig path "
56 << fHLTConfig.triggerName(
j) << endl;
65 <<
"size of vector of paths to monitor = " << fMonitorPaths.size()
67 for (
unsigned int iPath = 0; iPath < fMonitorPaths.size(); iPath++) {
68 string monPath = fMonitorPaths[iPath];
69 LogTrace(
"HLTSeedL1LogicScalers") <<
"monPath = " << monPath << endl;
71 string folderName = fDQMFolder +
"/" + monPath;
75 if (fHLTConfig.triggerIndex(monPath) == fHLTConfig.size())
continue;
77 vector<pair<bool, string> > hltL1GTSeed = fHLTConfig.hltL1GTSeeds(monPath);
79 << endl <<
"size of vector of GTSeedL1LogicalExpression = "
80 << hltL1GTSeed.size() << endl;
83 for (
unsigned int iSeed = 0; iSeed < hltL1GTSeed.size(); iSeed++) {
85 <<
" TechBit_flag = " << hltL1GTSeed[iSeed].first
86 <<
" GTSeedL1LogicalExpression = " << hltL1GTSeed[iSeed].second
89 istringstream totalSString(hltL1GTSeed[iSeed].
second);
92 vector<string> l1Algos;
95 while (!hltL1GTSeed[iSeed].
first) {
96 totalSString >> temp_string;
98 if (!l1Algos.empty()) {
99 if (temp_string.compare(l1Algos.back()) == 0)
break;
101 if (temp_string !=
"OR" && temp_string !=
"AND" &&
102 temp_string !=
"NOT" && temp_string !=
"(" && temp_string !=
")" &&
104 l1Algos.push_back(temp_string);
108 int nL1Algo = l1Algos.size();
113 <<
" number of l1 Algos grater than 32. Using only the first 32."
117 int nBins = 1 << nL1Algo;
119 for (
unsigned int k = 0;
k < l1Algos.size();
k++) {
120 LogTrace(
"HLTSeedL1LogicScalers") <<
" l1 Algo = " << l1Algos[
k]
124 std::stringstream
title;
125 std::stringstream
name;
127 name << monPath <<
"_Seed_" << iSeed <<
"_L1BitLogic";
128 title << monPath <<
" BitPacked L1Algos of GTSeed " << iSeed <<
": '"
129 << hltL1GTSeed[iSeed].second <<
"'";
131 LogTrace(
"HLTSeedL1LogicScalers") <<
" MonitorElement name = " << name
133 LogTrace(
"HLTSeedL1LogicScalers") <<
" MonitorElement title = " << title
135 LogTrace(
"HLTSeedL1LogicScalers") <<
" MonitorElement nBins = " << nBins
141 fMonitorPathsME.push_back(me);
143 fMapMEL1Algos.push_back(make_pair(me, l1Algos));
150 LogDebug(
"HLTSeedL1LogicScalers") <<
"HLTSeedL1LogicScalers::analyze event ";
157 m_l1GtUtils.retrieveL1EventSetup(iSetup);
160 for (
unsigned int i = 0;
i < fMapMEL1Algos.size();
i++) {
164 const vector<string>& l1Algos = fMapMEL1Algos[
i].second;
167 unsigned int myL1Word = 0;
170 for (
unsigned int j = 0;
j < l1Algos.size();
j++) {
172 bool l1Pass = analyzeL1GtUtils(iEvent, iSetup, l1Algos[
j]);
173 LogTrace(
"HLTSeedL1LogicScalers") <<
"l1Algo = " << l1Algos[
j]
174 <<
" l1Pass = " << l1Pass << endl;
177 myL1Word |= (1 <<
j);
186 const string& l1AlgoName) {
187 LogTrace(
"HLTSeedL1LogicScalers") <<
"analyzeL1GtUtils..." << endl;
194 LogTrace(
"HLTSeedL1LogicScalers") <<
"l1AlgoName = " << l1AlgoName << endl;
196 bool decisionAlgTechTrig =
false;
200 decisionAlgTechTrig = m_l1GtUtils.decisionBeforeMask(
201 iEvent, fL1GtRecordInputTag, fL1GtDaqReadoutRecordInputTag, l1AlgoName,
204 decisionAlgTechTrig = m_l1GtUtils.decisionAfterMask(
205 iEvent, fL1GtRecordInputTag, fL1GtDaqReadoutRecordInputTag, l1AlgoName,
210 <<
"bool L1BeforeMask = " << fL1BeforeMask
211 <<
" decisionAlgTechTrig = " << decisionAlgTechTrig << endl;
213 if (iErrorCode == 0) {
214 return decisionAlgTechTrig;
215 }
else if (iErrorCode == 1) {
218 <<
"L1 algorithm " << l1AlgoName
219 <<
" not in L1 menu, but HLTConfigProvider found it in "
220 "L1SeedsLogicalExpression of at least one HLT path of the HLT menu."
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
bool analyzeL1GtUtils(const edm::Event &, const edm::EventSetup &, const std::string &)
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &c)
HLTSeedL1LogicScalers(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
U second(std::pair< T, U > const &p)
MonitorElement * book1D(Args &&...args)
void setCurrentFolder(const std::string &fullpath)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T first(std::pair< T, U > const &p)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)