18 using namespace trigger;
35 LogDebug(
"HLTSeedL1LogicScalers") <<
"constructor" ;
39 fL1BeforeMask = iConfig.
getParameter<
bool>(
"l1BeforeMask");
50 fDQMFolder = iConfig.
getUntrackedParameter(
"DQMFolder",
string(
"HLT/HLTSeedL1LogicScalers/HLT_LogicL1"));
56 LogInfo(
"HLTSeedL1LogicScalers") <<
"unable to get DQMStore service?";
59 fDbe->setCurrentFolder(fDQMFolder);
73 LogDebug(
"HLTSeedL1LogicScalers") <<
"HLTSeedL1LogicScalers::analyze event " ;
80 m_l1GtUtils.retrieveL1EventSetup(iSetup);
83 for (
unsigned int i=0;
i<fMapMEL1Algos.size();
i++) {
88 const vector<string>& l1Algos = fMapMEL1Algos[
i].second;
91 unsigned int myL1Word = 0;
94 for (
unsigned int j=0;
j<l1Algos.size();
j++) {
97 bool l1Pass = analyzeL1GtUtils(iEvent, iSetup, l1Algos[
j]);
98 LogTrace(
"HLTSeedL1LogicScalers") <<
"l1Algo = " << l1Algos[
j] <<
" l1Pass = " << l1Pass << endl;
123 LogTrace(
"HLTSeedL1LogicScalers") <<
"beginRun, run " << run.
id();
124 fDbe->setCurrentFolder(fDQMFolder);
128 bool changed =
false;
130 if (!fHLTConfig.init(run, iSetup, fProcessname, changed)) {
132 LogDebug(
"HLTSeedL1LogicScalers") <<
"HLTConfigProvider failed to initialize.";
141 const unsigned int n(fHLTConfig.size());
143 for (
unsigned int j=0;
j!=
n; ++
j) {
145 LogTrace(
"HLTSeedL1LogicScalers") <<
"HLTConfig path " << fHLTConfig.triggerName(
j) << endl;
150 LogTrace(
"HLTSeedL1LogicScalers") <<
"size of vector of paths to monitor = " << fMonitorPaths.size() << endl;
151 for (
unsigned int iPath=0;iPath<fMonitorPaths.size();iPath++) {
153 string monPath = fMonitorPaths[iPath];
154 LogTrace(
"HLTSeedL1LogicScalers") <<
"monPath = " << monPath << endl;
156 string folderName = fDQMFolder +
"/" + monPath;
157 fDbe->setCurrentFolder(folderName);
160 if(fHLTConfig.triggerIndex(monPath) == fHLTConfig.size())
continue;
162 vector<pair<bool,string> > hltL1GTSeed = fHLTConfig.hltL1GTSeeds(monPath);
163 LogTrace(
"HLTSeedL1LogicScalers") << endl <<
"size of vector of GTSeedL1LogicalExpression = " << hltL1GTSeed.size() << endl;
166 for (
unsigned int iSeed=0;iSeed<hltL1GTSeed.size();iSeed++) {
168 LogTrace(
"HLTSeedL1LogicScalers") <<
" TechBit_flag = " << hltL1GTSeed[iSeed].first <<
" GTSeedL1LogicalExpression = " << hltL1GTSeed[iSeed].second << endl;;
170 istringstream totalSString( hltL1GTSeed[iSeed].
second );
173 vector<string> l1Algos;
176 while(! hltL1GTSeed[iSeed].
first) {
178 totalSString >> temp_string;
180 if(! l1Algos.empty()) {
182 if(temp_string.compare(l1Algos.back()) == 0)
break;
185 if(temp_string !=
"OR" && temp_string !=
"AND" && temp_string !=
"NOT" && temp_string !=
"(" && temp_string !=
")" && temp_string !=
""){
187 l1Algos.push_back(temp_string);
192 int nL1Algo = l1Algos.size();
197 LogWarning(
"HLTSeedL1LogicScalers") <<
" number of l1 Algos grater than 32. Using only the first 32." << endl ;
201 int nBins = 1 << nL1Algo;
203 for (
unsigned int k=0;
k< l1Algos.size();
k++) {
205 LogTrace(
"HLTSeedL1LogicScalers") <<
" l1 Algo = " << l1Algos[
k] << endl;
213 std::stringstream
title;
214 std::stringstream
name;
216 name << monPath <<
"_Seed_" << iSeed <<
"_L1BitLogic";
217 title << monPath <<
" BitPacked L1Algos of GTSeed " << iSeed <<
": '" << hltL1GTSeed[iSeed].second <<
"'";
222 LogTrace(
"HLTSeedL1LogicScalers") <<
" MonitorElement name = " << name << endl;
223 LogTrace(
"HLTSeedL1LogicScalers") <<
" MonitorElement title = " << title << endl;
224 LogTrace(
"HLTSeedL1LogicScalers") <<
" MonitorElement nBins = " << nBins << endl << endl;
226 MonitorElement* me = fDbe->book1D(name.str().c_str(), title.str().c_str(), nBins,0,nBins);
228 fMonitorPathsME.push_back(me);
235 fMapMEL1Algos.push_back(make_pair(me, l1Algos));
258 LogTrace(
"HLTSeedL1LogicScalers") <<
"analyzeL1GtUtils..." << endl;
266 LogTrace(
"HLTSeedL1LogicScalers") <<
"l1AlgoName = " << l1AlgoName << endl;
268 bool decisionAlgTechTrig =
false;
273 decisionAlgTechTrig = m_l1GtUtils.decisionBeforeMask(iEvent, fL1GtRecordInputTag, fL1GtDaqReadoutRecordInputTag, l1AlgoName, iErrorCode);
278 decisionAlgTechTrig = m_l1GtUtils.decisionAfterMask(iEvent, fL1GtRecordInputTag, fL1GtDaqReadoutRecordInputTag, l1AlgoName, iErrorCode);
282 LogTrace(
"HLTSeedL1LogicScalers") <<
"bool L1BeforeMask = " << fL1BeforeMask <<
" decisionAlgTechTrig = " << decisionAlgTechTrig << endl;
284 if (iErrorCode == 0) {
286 return decisionAlgTechTrig;
288 }
else if (iErrorCode == 1) {
291 LogWarning(
"HLTSeedL1LogicScalers") <<
"L1 algorithm " << l1AlgoName <<
" not in L1 menu, but HLTConfigProvider found it in L1SeedsLogicalExpression of at least one HLT path of the HLT menu." << endl;
308 LogTrace(
"HLTSeedL1LogicScalers") <<
"analyzeL1GtRecord.. " << endl;
bool analyzeL1GtRecord(const edm::Event &, const edm::EventSetup &, std::string)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
bool analyzeL1GtUtils(const edm::Event &, const edm::EventSetup &, const std::string &)
HLTSeedL1LogicScalers(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
U second(std::pair< T, U > const &p)
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)