17 using namespace trigger;
34 LogDebug(
"HLTSeedL1LogicScalers") <<
"constructor" ;
38 fL1BeforeMask = iConfig.
getParameter<
bool>(
"l1BeforeMask");
49 fDQMFolder = iConfig.
getUntrackedParameter(
"DQMFolder",
string(
"HLT/HLTSeedL1LogicScalers/HLT_LogicL1"));
55 LogInfo(
"HLTSeedL1LogicScalers") <<
"unable to get DQMStore service?";
58 fDbe->setCurrentFolder(fDQMFolder);
72 LogDebug(
"HLTSeedL1LogicScalers") <<
"HLTSeedL1LogicScalers::analyze event " ;
79 m_l1GtUtils.retrieveL1EventSetup(iSetup);
82 for (
unsigned int i=0;
i<fMapMEL1Algos.size();
i++) {
87 const vector<string>& l1Algos = fMapMEL1Algos[
i].second;
90 unsigned int myL1Word = 0;
93 for (
unsigned int j=0;
j<l1Algos.size();
j++) {
96 bool l1Pass = analyzeL1GtUtils(iEvent, iSetup, l1Algos[
j]);
97 LogTrace(
"HLTSeedL1LogicScalers") <<
"l1Algo = " << l1Algos[
j] <<
" l1Pass = " << l1Pass << endl;
122 LogTrace(
"HLTSeedL1LogicScalers") <<
"beginRun, run " << run.
id();
123 fDbe->setCurrentFolder(fDQMFolder);
127 bool changed =
false;
129 if (!fHLTConfig.init(run, iSetup, fProcessname, changed)) {
131 LogDebug(
"HLTSeedL1LogicScalers") <<
"HLTConfigProvider failed to initialize.";
140 const unsigned int n(fHLTConfig.size());
142 for (
unsigned int j=0;
j!=
n; ++
j) {
144 LogTrace(
"HLTSeedL1LogicScalers") <<
"HLTConfig path " << fHLTConfig.triggerName(
j) << endl;
149 LogTrace(
"HLTSeedL1LogicScalers") <<
"size of vector of paths to monitor = " << fMonitorPaths.size() << endl;
150 for (
unsigned int iPath=0;iPath<fMonitorPaths.size();iPath++) {
152 string monPath = fMonitorPaths[iPath];
153 LogTrace(
"HLTSeedL1LogicScalers") <<
"monPath = " << monPath << endl;
155 string folderName = fDQMFolder +
"/" + monPath;
156 fDbe->setCurrentFolder(folderName);
159 if(fHLTConfig.triggerIndex(monPath) == fHLTConfig.size())
continue;
161 vector<pair<bool,string> > hltL1GTSeed = fHLTConfig.hltL1GTSeeds(monPath);
162 LogTrace(
"HLTSeedL1LogicScalers") << endl <<
"size of vector of GTSeedL1LogicalExpression = " << hltL1GTSeed.size() << endl;
165 for (
unsigned int iSeed=0;iSeed<hltL1GTSeed.size();iSeed++) {
167 LogTrace(
"HLTSeedL1LogicScalers") <<
" TechBit_flag = " << hltL1GTSeed[iSeed].first <<
" GTSeedL1LogicalExpression = " << hltL1GTSeed[iSeed].second << endl;;
169 istringstream totalSString( hltL1GTSeed[iSeed].
second );
172 vector<string> l1Algos;
175 while(! hltL1GTSeed[iSeed].
first) {
177 totalSString >> temp_string;
179 if(! l1Algos.empty()) {
181 if(temp_string.compare(l1Algos.back()) == 0)
break;
184 if(temp_string !=
"OR" && temp_string !=
"AND" && temp_string !=
"NOT" && temp_string !=
"(" && temp_string !=
")" && temp_string !=
""){
186 l1Algos.push_back(temp_string);
191 int nL1Algo = l1Algos.size();
196 LogWarning(
"HLTSeedL1LogicScalers") <<
" number of l1 Algos grater than 32. Using only the first 32." << endl ;
200 int nBins = 1 << nL1Algo;
202 for (
unsigned int k=0;
k< l1Algos.size();
k++) {
204 LogTrace(
"HLTSeedL1LogicScalers") <<
" l1 Algo = " << l1Algos[
k] << endl;
212 std::stringstream
title;
213 std::stringstream
name;
215 name << monPath <<
"_Seed_" << iSeed <<
"_L1BitLogic";
216 title << monPath <<
" BitPacked L1Algos of GTSeed " << iSeed <<
": '" << hltL1GTSeed[iSeed].second <<
"'";
221 LogTrace(
"HLTSeedL1LogicScalers") <<
" MonitorElement name = " << name << endl;
222 LogTrace(
"HLTSeedL1LogicScalers") <<
" MonitorElement title = " << title << endl;
223 LogTrace(
"HLTSeedL1LogicScalers") <<
" MonitorElement nBins = " << nBins << endl << endl;
225 MonitorElement* me = fDbe->book1D(name.str().c_str(), title.str().c_str(), nBins,0,nBins);
227 fMonitorPathsME.push_back(me);
234 fMapMEL1Algos.push_back(make_pair(me, l1Algos));
257 LogTrace(
"HLTSeedL1LogicScalers") <<
"analyzeL1GtUtils..." << endl;
265 LogTrace(
"HLTSeedL1LogicScalers") <<
"l1AlgoName = " << l1AlgoName << endl;
267 bool decisionAlgTechTrig =
false;
272 decisionAlgTechTrig = m_l1GtUtils.decisionBeforeMask(iEvent, fL1GtRecordInputTag, fL1GtDaqReadoutRecordInputTag, l1AlgoName, iErrorCode);
277 decisionAlgTechTrig = m_l1GtUtils.decisionAfterMask(iEvent, fL1GtRecordInputTag, fL1GtDaqReadoutRecordInputTag, l1AlgoName, iErrorCode);
281 LogTrace(
"HLTSeedL1LogicScalers") <<
"bool L1BeforeMask = " << fL1BeforeMask <<
" decisionAlgTechTrig = " << decisionAlgTechTrig << endl;
283 if (iErrorCode == 0) {
285 return decisionAlgTechTrig;
287 }
else if (iErrorCode == 1) {
290 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;
307 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)