CMS 3D CMS Logo

hltDiff.cc
Go to the documentation of this file.
1 /* hltDiff: compare TriggerResults event by event
2  *
3  * Compare two TriggerResults collections event by event.
4  * These can come from two collections in the same file(s), or from two different sets of files.
5  */
6 
7 #include <vector>
8 #include <set>
9 #include <string>
10 #include <iostream>
11 #include <sstream>
12 #include <fstream>
13 #include <cstdio>
14 #include <iomanip>
15 #include <memory>
16 #include <algorithm>
17 
18 #include <cstring>
19 #include <unistd.h>
20 #include <getopt.h>
21 #include <cstdio>
22 #include <cmath>
23 
24 #include <boost/algorithm/string.hpp>
25 #include <boost/filesystem.hpp>
26 
27 #include <TFile.h>
28 #include <TCanvas.h>
29 #include <TH1F.h>
30 #include <TH2F.h>
31 #include <TGraphAsymmErrors.h>
32 
43 
44 void error(std::ostream& out) { out << "Try 'hltDiff --help' for more information" << std::endl; }
45 
46 void error(std::ostream& out, const char* message) {
47  out << message << std::endl;
48  error(out);
49 }
50 
51 void error(std::ostream& out, const std::string& message) {
52  out << message << std::endl;
53  error(out);
54 }
55 
57 public:
58  virtual ~HLTConfigInterface() = default;
59  virtual std::string const& processName() const = 0;
60  virtual unsigned int size() const = 0;
61  virtual unsigned int size(unsigned int trigger) const = 0;
62  virtual std::string const& triggerName(unsigned int trigger) const = 0;
63  virtual unsigned int triggerIndex(unsigned int trigger) const = 0;
64  virtual std::string const& moduleLabel(unsigned int trigger, unsigned int module) const = 0;
65  virtual std::string const& moduleType(unsigned int trigger, unsigned int module) const = 0;
66  virtual bool prescaler(unsigned int trigger, unsigned int module) const = 0;
67 };
68 
70 public:
72  for (unsigned int t = 0; t < data_.size(); ++t) {
73  prescalers_[t].resize(size(t));
74  moduleTypes_[t].resize(size(t));
75  for (unsigned int m = 0; m < data_.size(t); ++m) {
77  prescalers_[t][m] = (type == "HLTPrescaler");
78  moduleTypes_[t][m] = &*moduleTypeSet_.insert(std::move(type)).first;
79  }
80  }
81  }
82  ~HLTConfigDataEx() override = default;
83  std::string const& processName() const override { return data_.processName(); }
84 
85  unsigned int size() const override { return data_.size(); }
86 
87  unsigned int size(unsigned int trigger) const override { return data_.size(trigger); }
88 
89  virtual std::vector<std::string> const& triggerNames() const { return data_.triggerNames(); }
90 
91  std::string const& triggerName(unsigned int trigger) const override { return data_.triggerName(trigger); }
92 
93  unsigned int triggerIndex(unsigned int trigger) const override { return trigger; }
94 
95  std::string const& moduleLabel(unsigned int trigger, unsigned int module) const override {
97  }
98 
99  std::string const& moduleType(unsigned int trigger, unsigned int module) const override {
100  return *moduleTypes_.at(trigger).at(module);
101  }
102 
103  bool prescaler(unsigned int trigger, unsigned int module) const override {
104  return prescalers_.at(trigger).at(module);
105  }
106 
107 private:
109  std::set<std::string> moduleTypeSet_;
110  std::vector<std::vector<std::string const*>> moduleTypes_;
111  std::vector<std::vector<bool>> prescalers_;
112 };
113 
114 const char* event_state(bool state) { return state ? "accepted" : "rejected"; }
115 
117 public:
118  enum class Index { First = 0, Second = 1 };
119 
120  class View : public HLTConfigInterface {
121  public:
123  ~View() override = default;
124  std::string const& processName() const override;
125  unsigned int size() const override;
126  unsigned int size(unsigned int trigger) const override;
127  std::string const& triggerName(unsigned int trigger) const override;
128  unsigned int triggerIndex(unsigned int trigger) const override;
129  std::string const& moduleLabel(unsigned int trigger, unsigned int module) const override;
130  std::string const& moduleType(unsigned int trigger, unsigned int module) const override;
131  bool prescaler(unsigned int trigger, unsigned int module) const override;
132 
133  private:
136  };
137 
139  : first_(first), second_(second), firstView_(*this, Index::First), secondView_(*this, Index::Second) {
140  for (unsigned int f = 0; f < first.size(); ++f)
141  for (unsigned int s = 0; s < second.size(); ++s)
142  if (first.triggerName(f) == second.triggerName(s)) {
143  triggerIndices_.push_back(std::make_pair(f, s));
144  break;
145  }
146  }
147 
148  View const& getView(Index index) const {
149  if (index == Index::First)
150  return firstView_;
151  else
152  return secondView_;
153  }
154 
156  if (index == Index::First)
157  return first_.processName();
158  else
159  return second_.processName();
160  }
161 
162  unsigned int size(Index index) const { return triggerIndices_.size(); }
163 
164  unsigned int size(Index index, unsigned int trigger) const {
165  if (index == Index::First)
166  return first_.size(trigger);
167  else
168  return second_.size(trigger);
169  }
170 
171  std::string const& triggerName(Index index, unsigned int trigger) const {
172  if (index == Index::First)
173  return first_.triggerName(triggerIndices_.at(trigger).first);
174  else
175  return second_.triggerName(triggerIndices_.at(trigger).second);
176  }
177 
178  unsigned int triggerIndex(Index index, unsigned int trigger) const {
179  if (index == Index::First)
180  return triggerIndices_.at(trigger).first;
181  else
182  return triggerIndices_.at(trigger).second;
183  }
184 
185  std::string const& moduleLabel(Index index, unsigned int trigger, unsigned int module) const {
186  if (index == Index::First)
187  return first_.moduleLabel(triggerIndices_.at(trigger).first, module);
188  else
189  return second_.moduleLabel(triggerIndices_.at(trigger).second, module);
190  }
191 
192  std::string const& moduleType(Index index, unsigned int trigger, unsigned int module) const {
193  if (index == Index::First)
194  return first_.moduleType(triggerIndices_.at(trigger).first, module);
195  else
196  return second_.moduleType(triggerIndices_.at(trigger).second, module);
197  }
198 
199  bool prescaler(Index index, unsigned int trigger, unsigned int module) const {
200  if (index == Index::First)
201  return first_.prescaler(triggerIndices_.at(trigger).first, module);
202  else
203  return second_.prescaler(triggerIndices_.at(trigger).second, module);
204  }
205 
206 private:
209 
212 
213  std::vector<std::pair<unsigned int, unsigned int>> triggerIndices_;
214 };
215 
217 
218 unsigned int HLTCommonConfig::View::size() const { return config_.size(index_); }
219 
220 unsigned int HLTCommonConfig::View::size(unsigned int trigger) const { return config_.size(index_, trigger); }
221 
223  return config_.triggerName(index_, trigger);
224 }
225 
226 unsigned int HLTCommonConfig::View::triggerIndex(unsigned int trigger) const {
227  return config_.triggerIndex(index_, trigger);
228 }
229 
230 std::string const& HLTCommonConfig::View::moduleLabel(unsigned int trigger, unsigned int module) const {
231  return config_.moduleLabel(index_, trigger, module);
232 }
233 
234 std::string const& HLTCommonConfig::View::moduleType(unsigned int trigger, unsigned int module) const {
235  return config_.moduleType(index_, trigger, module);
236 }
237 
238 bool HLTCommonConfig::View::prescaler(unsigned int trigger, unsigned int module) const {
239  return config_.prescaler(index_, trigger, module);
240 }
241 
242 enum State {
249 };
250 
251 const char* path_state(State state) {
252  static const char* message[] = {"not run", "accepted", "rejected", "exception", "prescaled", "invalid"};
253 
254  if (state > 0 and state < Invalid)
255  return message[state];
256  else
257  return message[Invalid];
258 }
259 
260 inline State prescaled_state(int state, int path, int module, HLTConfigInterface const& config) {
261  if (state == Fail and config.prescaler(path, module))
262  return Prescaled;
263  return (State)state;
264 }
265 
266 // return a copy of a string denoting an InputTag without the process name
267 // i.e.
268 // "module" --> "module"
269 // "module:instance" --> "module:instance"
270 // "module::process" --> "module"
271 // "module:instance:process" --> "module:instance"
272 //
274  if (std::count(s.begin(), s.end(), ':') == 2) {
275  // remove the process name and the second ':' separator
276  size_t end = s.find_last_of(':');
277  if (end > 0 and s.at(end - 1) == ':')
278  // no instance name, remove also the first ':' separator
279  --end;
280  return s.substr(0, end);
281  } else {
282  // no process name, return the string unchanged
283  return s;
284  }
285 }
286 
287 void print_detailed_path_state(std::ostream& out, State state, int path, int module, HLTConfigInterface const& config) {
288  auto const& label = config.moduleLabel(path, module);
289  auto const& type = config.moduleType(path, module);
290 
291  out << "'" << path_state(state) << "'";
292  if (state == Fail)
293  out << " by module " << module << " '" << label << "' [" << type << "]";
294  else if (state == Exception)
295  out << " at module " << module << " '" << label << "' [" << type << "]";
296 }
297 
299  // find the index of the collection of trigger candidates corresponding to the filter
300  unsigned int index = summary.filterIndex(filter);
301 
302  if (index >= summary.sizeFilters()) {
303  // the collection of trigger candidates corresponding to the filter could not be found
304  out << " not found\n";
305  return;
306  }
307 
308  if (summary.filterKeys(index).empty()) {
309  // the collection of trigger candidates corresponding to the filter is empty
310  out << " none\n";
311  return;
312  }
313 
314  for (unsigned int i = 0; i < summary.filterKeys(index).size(); ++i) {
315  auto key = summary.filterKeys(index)[i];
316  auto id = summary.filterIds(index)[i];
317  trigger::TriggerObject const& candidate = summary.getObjects().at(key);
318  out << " "
319  << "filter id: " << id << ", "
320  << "object id: " << candidate.id() << ", "
321  << "pT: " << candidate.pt() << ", "
322  << "eta: " << candidate.eta() << ", "
323  << "phi: " << candidate.phi() << ", "
324  << "mass: " << candidate.mass() << "\n";
325  }
326 }
327 
329  auto iterator = std::find(summary.collectionTags().begin(), summary.collectionTags().end(), tag);
330  if (iterator == summary.collectionTags().end()) {
331  // the collection of trigger candidates could not be found
332  out << " not found\n";
333  return;
334  }
335 
336  unsigned int index = iterator - summary.collectionTags().begin();
337  unsigned int begin = (index == 0) ? 0 : summary.collectionKey(index - 1);
338  unsigned int end = summary.collectionKey(index);
339 
340  if (end == begin) {
341  // the collection of trigger candidates is empty
342  out << " none\n";
343  return;
344  }
345 
346  for (unsigned int key = begin; key < end; ++key) {
347  trigger::TriggerObject const& candidate = summary.getObjects().at(key);
348  out << " "
349  << "object id: " << candidate.id() << ", "
350  << "pT: " << candidate.pt() << ", "
351  << "eta: " << candidate.eta() << ", "
352  << "phi: " << candidate.phi() << ", "
353  << "mass: " << candidate.mass() << "\n";
354  }
355 }
356 
358  std::vector<boost::iterator_range<std::string::const_iterator>> tokens;
359  boost::split(tokens, branch, boost::is_any_of("_."), boost::token_compress_off);
360  return boost::copy_range<std::string>(tokens[3]);
361 }
362 
363 std::unique_ptr<HLTConfigDataEx> getHLTConfigData(fwlite::EventBase const& event, std::string process) {
364  auto const& history = event.processHistory();
365  if (process.empty()) {
366  // determine the process name from the most recent "TriggerResults" object
367  auto const& branch =
368  event.getBranchNameFor(edm::Wrapper<edm::TriggerResults>::typeInfo(), "TriggerResults", "", process.c_str());
370  }
371 
373  if (not history.getConfigurationForProcess(process, config)) {
374  std::cerr << "error: the process " << process << " is not in the Process History" << std::endl;
375  exit(1);
376  }
378  if (pset == nullptr) {
379  std::cerr << "error: the configuration for the process " << process << " is not available in the Provenance"
380  << std::endl;
381  exit(1);
382  }
383  return std::make_unique<HLTConfigDataEx>(HLTConfigData(pset));
384 }
385 
386 struct TriggerDiff {
387  TriggerDiff() : count(0), gained(0), lost(0), internal(0) {}
388 
389  unsigned int count;
390  unsigned int gained;
391  unsigned int lost;
392  unsigned int internal;
393 
394  static std::string format(unsigned int value, char sign = '+') {
395  if (value == 0)
396  return std::string("-");
397 
398  char buffer[12]; // sign, 10 digits, null
399  memset(buffer, 0, 12);
400 
401  unsigned int digit = 10;
402  while (value > 0) {
403  buffer[digit] = value % 10 + 48;
404  value /= 10;
405  --digit;
406  }
407  buffer[digit] = sign;
408 
409  return std::string(buffer + digit);
410  }
411 
412  unsigned int total() const { return this->gained + this->lost + this->internal; }
413 };
414 
415 std::ostream& operator<<(std::ostream& out, TriggerDiff diff) {
416  out << std::setw(12) << diff.count << std::setw(12) << TriggerDiff::format(diff.gained, '+') << std::setw(12)
417  << TriggerDiff::format(diff.lost, '-') << std::setw(12) << TriggerDiff::format(diff.internal, '~');
418  return out;
419 }
420 
422 private:
423  static size_t tab_spaces;
424 
425  // static variables and methods for printing specific JSON elements
426  static std::string indent(size_t _nTabs) {
427  std::string str = "\n";
428  while (_nTabs) {
429  int nSpaces = tab_spaces;
430  while (nSpaces) {
431  str.push_back(' ');
432  nSpaces--;
433  }
434  _nTabs--;
435  }
436 
437  return str;
438  }
439 
440  static std::string key(const std::string& _key, const std::string& _delim = "") {
441  std::string str = "\"\":";
442  str.insert(1, _key);
443  str.append(_delim);
444 
445  return str;
446  }
447 
448  static std::string key_string(const std::string& _key, const std::string& _string, const std::string& _delim = "") {
449  std::string str = key(_key, _delim);
450  str.push_back('"');
451  str.append(_string);
452  str.push_back('"');
453  return str;
454  }
455 
456  static std::string key_int(const std::string& _key, int _int, const std::string& _delim = "") {
457  std::string str = key(_key, _delim);
458  str.append(std::to_string(_int));
459 
460  return str;
461  }
462 
463  static std::string string(const std::string& _string, const std::string& _delim = "") {
464  std::string str = "\"\"";
465  str.insert(1, _string);
466  str.append(_delim);
467 
468  return str;
469  }
470 
471  static std::string list_string(const std::vector<std::string>& _values, const std::string& _delim = "") {
472  std::string str = "[";
473  for (auto it = _values.begin(); it != _values.end(); ++it) {
474  str.append(_delim);
475  str.push_back('"');
476  str.append(*it);
477  str.push_back('"');
478  if (it != --_values.end())
479  str.push_back(',');
480  }
481  str.append(_delim);
482  str.push_back(']');
483 
484  return str;
485  }
486 
487 public:
488  bool writeJson;
491  // structs holding particular JSON objects
493  std::string file_base; // common part at the beginning of all files
494  std::vector<std::string> files;
496  std::vector<std::string> skipped_triggers;
497 
498  std::string serialise(size_t _indent = 0) const {
499  std::ostringstream json;
500  json << indent(_indent); // line
501  json << key_string("file_base", file_base) << ',';
502  json << indent(_indent); // line
503  json << key("files") << list_string(files) << ',';
504  json << indent(_indent); // line
505  json << key_string("process", process) << ',';
506  json << indent(_indent); // line
507  json << key("skipped_triggers") << list_string(skipped_triggers);
508 
509  return json.str();
510  }
511 
513  std::string file0 = files.at(0);
514  // determining the last position at which all filenames have the same character
515  for (size_t i = 0; i < file0.length(); ++i) {
516  bool identicalInAll = true;
517  char character = file0.at(i);
518  for (std::string file : files) {
519  if (file.at(i) == character)
520  continue;
521  identicalInAll = false;
522  break;
523  }
524  if (!identicalInAll)
525  break;
526  file_base.push_back(character);
527  }
528  const unsigned int file_base_len = file_base.length();
529  if (file_base_len < 1)
530  return;
531  // removing the file_base from each filename
532  for (std::string& file : files) {
533  file.erase(0, file_base_len);
534  }
535  }
536 
537  JsonConfigurationBlock() : file_base(""), files(0), process(""), skipped_triggers(0) {}
538  };
539 
543  bool prescales;
544  int events;
545 
546  std::string serialise(size_t _indent = 0) const {
547  std::ostringstream json;
548  json << indent(_indent) << key("configuration") << '{'; // line open
549  json << indent(_indent + 1) << key("o") << '{'; // line open
550  json << o.serialise(_indent + 2); // block
551  json << indent(_indent + 1) << "},"; // line close
552  json << indent(_indent + 1) << key("n") << '{'; // line open
553  json << n.serialise(_indent + 2); // line block
554  json << indent(_indent + 1) << "},"; // line close
555  std::string prescales_str = prescales ? "true" : "false";
556  json << indent(_indent + 1) << key("prescales") << prescales_str << ','; // line
557  json << indent(_indent + 1) << key("events") << events; // line
558  json << indent(_indent) << "}"; // line close
559 
560  return json.str();
561  }
562 
563  JsonConfiguration() : o(), n() {}
564  };
565 
566  struct JsonVars {
567  std::vector<std::string> state;
568  std::vector<std::string> trigger;
569  std::vector<std::pair<int, int>> trigger_passed_count; // <old, new>
570  std::vector<std::string> label;
571  std::vector<std::string> type;
572 
573  std::string serialise(size_t _indent = 0) const {
574  std::ostringstream json;
575  json << indent(_indent) << key("vars") << '{'; // line open
576  json << indent(_indent + 1) << key("state") << list_string(state) << ','; // line
577  json << indent(_indent + 1) << key("trigger") << list_string(trigger) << ','; // line
578  json << indent(_indent + 1) << key("trigger_passed_count") << '['; // line
579  for (auto it = trigger_passed_count.begin(); it != trigger_passed_count.end(); ++it) {
580  json << '{' << key("o") << (*it).first << ',' << key("n") << (*it).second << '}';
581  if (it != trigger_passed_count.end() - 1)
582  json << ',';
583  }
584  json << "],";
585  json << indent(_indent + 1) << key("label") << list_string(label) << ','; // line
586  json << indent(_indent + 1) << key("type") << list_string(type); // line
587  json << indent(_indent) << '}'; // line close
588 
589  return json.str();
590  }
591 
592  JsonVars() : state(0), trigger(0), trigger_passed_count(0), label(0), type(0) {}
593  };
594 
595  // class members
598 
599 private:
600  unsigned int labelId(std::string labelName) {
601  unsigned int id = std::find(vars.label.begin(), vars.label.end(), labelName) - vars.label.begin();
602  if (id < vars.label.size())
603  return id;
604  vars.label.push_back(labelName);
605  return vars.label.size() - 1;
606  }
607 
608  unsigned int typeId(std::string typeName) {
609  unsigned int id = std::find(vars.type.begin(), vars.type.end(), typeName) - vars.type.begin();
610  if (id < vars.type.size())
611  return id;
612  vars.type.push_back(typeName);
613  return vars.type.size() - 1;
614  }
615 
616 public:
617  struct JsonEventState {
618  State s; // state
619  int m; // module id
620  int l; // label id
621  int t; // type id
622 
623  std::string serialise(size_t _indent = 0) const {
624  std::ostringstream json;
625  json << key_int("s", int(s)); // line
626  // No more information needed if the state is 'accepted'
627  if (s == State::Pass)
628  return json.str();
629  json << ',';
630  json << key_int("m", m) << ',';
631  json << key_int("l", l) << ',';
632  json << key_int("t", t);
633 
634  return json.str();
635  }
636 
637  JsonEventState() : s(State::Ready), m(-1), l(-1), t(-1) {}
638  JsonEventState(State _s, int _m, int _l, int _t) : s(_s), m(_m), l(_l), t(_t) {}
639  };
640 
642  int tr; // trigger id
645 
646  std::string serialise(size_t _indent = 0) const {
647  std::ostringstream json;
648  json << indent(_indent) << key_int("t", tr) << ','; // line
649  json << indent(_indent) << key("o") << '{' << o.serialise() << "},"; // line
650  json << indent(_indent) << key("n") << '{' << n.serialise() << "}"; // line
651 
652  return json.str();
653  }
654 
655  JsonTriggerEventState() : tr(-1), o(), n() {}
656  JsonTriggerEventState(int _tr) : tr(_tr), o(), n() {}
657  };
658 
659  struct JsonEvent {
660  int run;
661  int lumi;
662  int event;
663  std::vector<JsonTriggerEventState> triggerStates;
664 
665  std::string serialise(size_t _indent = 0) const {
666  std::ostringstream json;
667  json << indent(_indent) << '{' << "\"r\"" << ':' << run << ",\"l\":" << lumi << ",\"e\":" << event
668  << ",\"t\":["; // line open
669  for (auto it = triggerStates.begin(); it != triggerStates.end(); ++it) {
670  json << '{'; // line open
671  json << (*it).serialise(_indent + 2); // block
672  json << indent(_indent + 1) << '}'; // line close
673  if (it != --triggerStates.end())
674  json << ',';
675  }
676  json << indent(_indent) << ']' << '}'; // line close
677 
678  return json.str();
679  }
680 
681  JsonEvent(int _run, int _lumi, int _event) : run(_run), lumi(_lumi), event(_event), triggerStates(0) {}
682 
684  // check whether the last trigger is the one
685  if (!triggerStates.empty()) {
686  JsonTriggerEventState& lastTrigger = triggerStates.back();
687  if (lastTrigger.tr == _tr)
688  return lastTrigger;
689  }
690  triggerStates.push_back(JsonTriggerEventState(_tr));
691  return triggerStates.back();
692  }
693  };
694 
695  // class members
696  std::map<int, std::vector<JsonEvent>> m_run_events;
697 
698  // methods
699  JsonOutputProducer(bool _writeJson, std::string _file_name)
700  : writeJson(_writeJson), out_filename_base(std::move(_file_name)) {
701  useSingleOutFile = out_filename_base.length() > 0;
702  }
703 
704  JsonEvent& pushEvent(int _run, int _lumi, int _event) {
705  // ensuring that this RUN is present in the producer
706  if ((m_run_events.count(_run) == 0 && !useSingleOutFile) || m_run_events.empty())
707  m_run_events.emplace(_run, std::vector<JsonEvent>());
708  std::vector<JsonEvent>& v_events = useSingleOutFile ? m_run_events.begin()->second : m_run_events.at(_run);
709  // check whether the last event is the one
710  if (!v_events.empty()) {
711  JsonEvent& lastEvent = v_events.back();
712  if (lastEvent.run == _run && lastEvent.lumi == _lumi && lastEvent.event == _event)
713  return lastEvent;
714  }
715  v_events.push_back(JsonEvent(_run, _lumi, _event));
716  return v_events.back();
717  }
718 
719  JsonEventState eventState(State _s, int _m, const std::string& _l, const std::string& _t) {
720  return JsonEventState(_s, _m, this->labelId(_l), this->typeId(_t));
721  }
722 
724  if (useSingleOutFile)
725  return out_filename_base;
726 
727  char name[1000];
728  sprintf(name,
729  "DQM_V0001_R%.9d__OLD_%s__NEW_%s_DQM",
730  _run,
731  configuration.o.process.c_str(),
732  configuration.n.process.c_str());
733 
734  return std::string(name);
735  }
736 
737  void write() {
738  if (!writeJson)
739  return;
740  std::set<std::string> filesCreated;
741  std::ofstream out_file;
742  if (!m_run_events.empty()) {
743  // Creating a separate file for each run
744  for (const auto& runEvents : m_run_events) {
745  const int run = runEvents.first;
746  const std::vector<JsonEvent>& v_events = runEvents.second;
747  // Writing the output to a JSON file
748  std::string output_name = output_filename_base(run) += ".json";
749  out_file.open(output_name, std::ofstream::out);
750  out_file << '{'; // line open
751  out_file << configuration.serialise(1) << ',';
752  out_file << vars.serialise(1) << ',';
753  // writing block for each event
754  out_file << indent(1) << key("events") << '['; // line open
755  for (auto it = v_events.begin(); it != v_events.end(); ++it) {
756  out_file << (*it).serialise(2);
757  if (it != --v_events.end())
758  out_file << ',';
759  }
760  out_file << indent(1) << ']'; // line close
761  out_file << indent(0) << "}"; // line close
762  out_file.close();
763  // Adding file name to the list of created files
764  filesCreated.insert(output_name);
765  }
766  } else {
767  // Creating a single file containing with only configuration part
768  std::string output_name = output_filename_base(0) += ".json";
769  out_file.open(output_name, std::ofstream::out);
770  out_file << '{'; // line open
771  out_file << configuration.serialise(1) << ',';
772  out_file << vars.serialise(1) << ',';
773  // writing block for each event
774  out_file << indent(1) << key("events") << '['; // line open
775  // for (std::vector<JsonEvent>::const_iterator it = v_events.begin(); it != v_events.end(); ++it) {
776  // out_file << (*it).serialise(2);
777  // if (it != --v_events.end()) out_file << ',';
778  // }
779  out_file << indent(1) << ']'; // line close
780  out_file << indent(0) << "}"; // line close
781  out_file.close();
782  // Adding file name to the list of created files
783  filesCreated.insert(output_name);
784  }
785 
786  if (!filesCreated.empty()) {
787  std::cout << "Created the following JSON files:" << std::endl;
788  for (const std::string& filename : filesCreated)
789  std::cout << " " << filename << std::endl;
790  }
791  }
792 };
794 
796 private:
798  int run;
799 
800  struct Pair {
801  double v;
802  double e;
803 
804  Pair(double _v, double _e) : v(_v), e(_e){};
805  Pair(int _v, int _e) : v(_v), e(_e){};
806  };
807 
808  struct Event {
809  int run;
810  int lumi;
811  int event;
812 
813  Event(int _run, int _lumi, int _event) : run(_run), lumi(_lumi), event(_event){};
814  bool operator<(const Event& b) const { return std::tie(run, lumi, event) < std::tie(b.run, b.lumi, b.event); }
815  };
816 
817  struct GenericSummary {
819  int id;
821  std::set<Event> v_gained;
822  std::set<Event> v_lost;
823  std::set<Event> v_changed;
824 
825  GenericSummary(int _id, const JsonOutputProducer& _json, const std::vector<std::string>& _names)
826  : json(_json), id(_id) {
827  name = _names.at(id);
828  }
829 
830  int addEntry(const JsonOutputProducer::JsonEvent& _event, const int _triggerIndex) {
831  const JsonOutputProducer::JsonTriggerEventState& state = _event.triggerStates.at(_triggerIndex);
832  const Event event = Event(_event.run, _event.lumi, _event.event);
833  int moduleId = state.o.l;
834  if (state.o.s == State::Pass && state.n.s == State::Fail) {
835  moduleId = state.n.l;
836  v_lost.insert(event);
837  } else if (state.o.s == State::Fail && state.n.s == State::Pass) {
838  v_gained.insert(event);
839  } else if (state.o.s == State::Fail && state.n.s == State::Fail) {
840  v_changed.insert(event);
841  }
842 
843  return moduleId;
844  }
845 
846  Pair gained() const { return Pair(double(v_gained.size()), sqrt(double(v_gained.size()))); }
847 
848  Pair lost() const { return Pair(double(v_lost.size()), sqrt(double(v_lost.size()))); }
849 
850  Pair changed() const { return Pair(double(v_changed.size()), sqrt(double(v_changed.size()))); }
851 
852  bool keepForC() const { return !v_changed.empty(); }
853 
854  bool keepForGL() const { return !v_gained.empty() || !v_lost.empty(); }
855  };
856 
860  std::map<int, GenericSummary> m_modules;
861 
862  TriggerSummary(int _id, const JsonOutputProducer& _json)
863  : GenericSummary(_id, _json, _json.vars.trigger),
864  accepted_o(_json.vars.trigger_passed_count.at(id).first),
865  accepted_n(_json.vars.trigger_passed_count.at(id).second) {}
866 
868  const int _triggerIndex,
869  const std::vector<std::string>& _moduleNames) {
870  int moduleLabelId = GenericSummary::addEntry(_event, _triggerIndex);
871  // Updating number of events affected by the particular module
872  if (m_modules.count(moduleLabelId) == 0)
873  m_modules.emplace(moduleLabelId, GenericSummary(moduleLabelId, json, _moduleNames));
874  m_modules.at(moduleLabelId).addEntry(_event, _triggerIndex);
875  }
876 
877  Pair gained(int type = 0) const {
878  Pair gained(GenericSummary::gained());
879  if (type == 0)
880  return gained; // Absolute number of affected events
881  double all(accepted_n);
882  Pair fraction = Pair(gained.v / (all + 1e-10), sqrt(all) / (all + 1e-10));
883  if (type == 1)
884  return fraction; // Relative number of affected events with respect to all accepted
885  if (type == 2)
886  return Pair(std::max(0.0, fraction.v - fraction.e), 0.0); // Smallest value given the uncertainty
887  return Pair(fraction.v / (fraction.e + 1e-10), 0.0); // Significance of the effect as N std. deviations
888  }
889 
890  Pair lost(int type = 0) const {
891  Pair lost(GenericSummary::lost());
892  if (type == 0)
893  return lost;
894  double all(accepted_o);
895  Pair fraction = Pair(lost.v / (all + 1e-10), sqrt(all) / (all + 1e-10));
896  if (type == 1)
897  return fraction;
898  if (type == 2)
899  return Pair(std::max(0.0, fraction.v - fraction.e), 0.0); // Smallest value given the uncertainty
900  return Pair(fraction.v / (fraction.e + 1e-10), 0.0);
901  }
902 
903  Pair changed(int type = 0) const {
904  Pair changed(GenericSummary::changed());
905  if (type == 0)
906  return changed;
907  double all(json.configuration.events - accepted_o);
908  Pair fraction = Pair(changed.v / (all + 1e-10), sqrt(all) / (all + 1e-10));
909  if (type == 1)
910  return fraction;
911  if (type == 2)
912  return Pair(std::max(0.0, fraction.v - fraction.e), 0.0); // Smallest value given the uncertainty
913  return Pair(fraction.v / (fraction.e + 1e-10), 0.0);
914  }
915  };
916 
917 private:
918  std::map<int, TriggerSummary> m_triggerSummary;
919  std::map<int, GenericSummary> m_moduleSummary;
920 
921  void prepareSummaries(const int _run, const std::vector<JsonOutputProducer::JsonEvent>& _events) {
922  this->run = _run;
923  // Initialising the summary objects for trigger/module
924  m_triggerSummary.clear();
925  m_moduleSummary.clear();
926  const size_t nTriggers(json.vars.trigger.size());
927  const size_t nModules(json.vars.label.size());
928  for (size_t i = 0; i < nTriggers; ++i)
929  m_triggerSummary.emplace(i, TriggerSummary(i, json));
930  for (size_t i = 0; i < nModules; ++i)
931  m_moduleSummary.emplace(i, GenericSummary(i, json, json.vars.label));
932 
933  // Add each affected trigger in each event to the trigger/module summary objects
934  for (const JsonOutputProducer::JsonEvent& event : _events) {
935  for (size_t iTrigger = 0; iTrigger < event.triggerStates.size(); ++iTrigger) {
936  const JsonOutputProducer::JsonTriggerEventState& state = event.triggerStates.at(iTrigger);
937  m_triggerSummary.at(state.tr).addEntry(event, iTrigger, json.vars.label);
938  const int moduleId = state.o.s == State::Fail ? state.o.l : state.n.l;
939  m_moduleSummary.at(moduleId).addEntry(event, iTrigger);
940  }
941  }
942  }
943 
945  std::map<std::string, TH1*> m_histo;
946  // Counting the numbers of bins for different types of histograms
947  // *_c - changed; *_gl - gained or lost
948  int nTriggers(0), nTriggers_c(0), nTriggers_gl(0), nModules_c(0), nModules_gl(0);
949 
950  for (const auto& idSummary : m_triggerSummary) {
951  if (idSummary.second.accepted_o > 0)
952  ++nTriggers;
953  if (idSummary.second.keepForGL())
954  ++nTriggers_gl;
955  if (idSummary.second.keepForC())
956  ++nTriggers_c;
957  }
958  for (const auto& idSummary : m_moduleSummary) {
959  if (idSummary.second.keepForGL())
960  ++nModules_gl;
961  if (idSummary.second.keepForC())
962  ++nModules_c;
963  }
964  // Manually increasing N bins to have histograms with meaningful axis ranges
965  nTriggers = std::max(1, nTriggers);
966  nTriggers_gl = std::max(1, nTriggers_gl);
967  nTriggers_c = std::max(1, nTriggers_c);
968  nModules_c = std::max(1, nModules_c);
969  nModules_gl = std::max(1, nModules_gl);
970 
971  // Initialising overview histograms
972  std::string name = "trigger_accepted";
973  m_histo.emplace(name, new TH1F(name.c_str(), ";;Events accepted^{OLD}", nTriggers, 0, nTriggers));
974  name = "trigger_gained";
975  m_histo.emplace(name, new TH1F(name.c_str(), ";;Events gained", nTriggers_gl, 0, nTriggers_gl));
976  name = "trigger_lost";
977  m_histo.emplace(name, new TH1F(name.c_str(), ";;Events lost", nTriggers_gl, 0, nTriggers_gl));
978  name = "trigger_changed";
979  m_histo.emplace(name, new TH1F(name.c_str(), ";;Events changed", nTriggers_c, 0, nTriggers_c));
980  name = "trigger_gained_frac";
981  m_histo.emplace(name, new TH1F(name.c_str(), ";;#frac{gained}{accepted}", nTriggers_gl, 0, nTriggers_gl));
982  name = "trigger_lost_frac";
983  m_histo.emplace(name, new TH1F(name.c_str(), ";;#frac{lost}{accepted}", nTriggers_gl, 0, nTriggers_gl));
984  name = "trigger_changed_frac";
985  m_histo.emplace(name, new TH1F(name.c_str(), ";;#frac{changed}{all - accepted}", nTriggers_c, 0, nTriggers_c));
986  name = "module_changed";
987  m_histo.emplace(name, new TH1F(name.c_str(), ";;Events changed", nModules_c, 0, nModules_c));
988  name = "module_gained";
989  m_histo.emplace(name, new TH1F(name.c_str(), ";;Events gained", nModules_gl, 0, nModules_gl));
990  name = "module_lost";
991  m_histo.emplace(name, new TH1F(name.c_str(), ";;Events lost", nModules_gl, 0, nModules_gl));
992 
993  // Filling the per-trigger bins in the summary histograms
994  size_t bin(0), bin_c(0), bin_gl(0);
995  for (const auto& idSummary : m_triggerSummary) {
996  const TriggerSummary& summary = idSummary.second;
997  if (summary.accepted_o > 0) {
998  ++bin;
999  // Setting bin contents
1000  m_histo.at("trigger_accepted")->SetBinContent(bin, summary.accepted_o);
1001  // Setting bin labels
1002  m_histo.at("trigger_accepted")->GetXaxis()->SetBinLabel(bin, summary.name.c_str());
1003  }
1004  if (summary.keepForGL()) {
1005  ++bin_gl;
1006  // Setting bin contents
1007  m_histo.at("trigger_gained")->SetBinContent(bin_gl, summary.gained().v);
1008  m_histo.at("trigger_lost")->SetBinContent(bin_gl, -summary.lost().v);
1009  m_histo.at("trigger_gained_frac")->SetBinContent(bin_gl, summary.gained(1).v);
1010  m_histo.at("trigger_lost_frac")->SetBinContent(bin_gl, -summary.lost(1).v);
1011  // Setting bin errors
1012  m_histo.at("trigger_gained_frac")->SetBinError(bin_gl, summary.gained(1).e);
1013  m_histo.at("trigger_lost_frac")->SetBinError(bin_gl, -summary.lost(1).e);
1014  // Setting bin labels
1015  m_histo.at("trigger_gained")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1016  m_histo.at("trigger_lost")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1017  m_histo.at("trigger_gained_frac")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1018  m_histo.at("trigger_lost_frac")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1019  }
1020  if (summary.keepForC()) {
1021  ++bin_c;
1022  // Setting bin contents
1023  m_histo.at("trigger_changed")->SetBinContent(bin_c, summary.changed().v);
1024  m_histo.at("trigger_changed_frac")->SetBinContent(bin_c, summary.changed(1).v);
1025  // Setting bin errors
1026  m_histo.at("trigger_changed_frac")->SetBinError(bin_c, summary.changed(1).e);
1027  // Setting bin labels
1028  m_histo.at("trigger_changed")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1029  m_histo.at("trigger_changed_frac")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1030  }
1031  }
1032 
1033  // Filling the per-module bins in the summary histograms
1034  bin = 0;
1035  bin_c = 0;
1036  bin_gl = 0;
1037  for (const auto& idSummary : m_moduleSummary) {
1038  ++bin;
1039  const GenericSummary& summary = idSummary.second;
1040  if (summary.keepForGL()) {
1041  ++bin_gl;
1042  // Setting bin contents
1043  m_histo.at("module_gained")->SetBinContent(bin_gl, summary.gained().v);
1044  m_histo.at("module_lost")->SetBinContent(bin_gl, -summary.lost().v);
1045  // Setting bin labels
1046  m_histo.at("module_gained")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1047  m_histo.at("module_lost")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1048  }
1049  if (summary.keepForC()) {
1050  ++bin_c;
1051  // Setting bin contents
1052  m_histo.at("module_changed")->SetBinContent(bin_c, summary.changed().v);
1053  // Setting bin labels
1054  m_histo.at("module_changed")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1055  }
1056  }
1057 
1058  // Styling the histograms
1059  for (const auto& nameHisto : m_histo) {
1060  const std::string name = nameHisto.first;
1061  TH1* histo = nameHisto.second;
1062  if (name.find("gained") != std::string::npos || name.find("changed") != std::string::npos) {
1063  if (name.find("frac") != std::string::npos)
1064  histo->GetYaxis()->SetRangeUser(0.0, 1.0);
1065  }
1066  if (name.find("lost") != std::string::npos) {
1067  if (name.find("frac") != std::string::npos)
1068  histo->GetYaxis()->SetRangeUser(-1.0, 0.0);
1069  }
1070  }
1071 
1072  // Storing histograms to a ROOT file
1073  std::string file_name = json.output_filename_base(this->run) += ".root";
1074  auto out_file = new TFile(file_name.c_str(), "RECREATE");
1075  // Storing the histograms in a proper folder according to the DQM convention
1076  char savePath[1000];
1077  sprintf(savePath, "DQMData/Run %d/HLT/Run summary/EventByEvent/", this->run);
1078  out_file->mkdir(savePath);
1079  gDirectory->cd(savePath);
1080  gDirectory->Write();
1081  for (const auto& nameHisto : m_histo)
1082  nameHisto.second->Write(nameHisto.first.c_str());
1083  out_file->Close();
1084 
1085  return file_name;
1086  }
1087 
1089  std::string file_name = json.output_filename_base(this->run) += "_trigger.csv";
1090  FILE* out_file = fopen((file_name).c_str(), "w");
1091 
1092  fprintf(out_file,
1093  "Total,Accepted OLD,Accepted NEW,Gained,Lost,|G|/A_N + "
1094  "|L|/AO,sigma(AN)+sigma(AO),Changed,C/(T-AO),sigma(T-AO),trigger\n");
1095  for (const auto& idSummary : m_triggerSummary) {
1096  const SummaryOutputProducer::TriggerSummary& S = idSummary.second;
1097  fprintf(out_file,
1098  "%d,%d,%d,%+.f,%+.f,%.2f%%,%.2f%%,~%.f,~%.2f%%,%.2f%%,%s\n",
1099  this->json.configuration.events,
1100  S.accepted_o,
1101  S.accepted_n,
1102  S.gained().v,
1103  -1.0 * S.lost().v,
1104  (S.gained(1).v + S.lost(1).v) * 100.0,
1105  (S.gained(1).e + S.lost(1).e) * 100.0,
1106  S.changed().v,
1107  S.changed(1).v * 100.0,
1108  S.changed(1).e * 100.0,
1109  S.name.c_str());
1110  }
1111 
1112  fclose(out_file);
1113 
1114  return file_name;
1115  }
1116 
1118  std::string file_name = json.output_filename_base(this->run) += "_module.csv";
1119  FILE* out_file = fopen((file_name).c_str(), "w");
1120 
1121  fprintf(out_file, "Total,Gained,Lost,Changed,module\n");
1122  for (const auto& idSummary : m_moduleSummary) {
1123  const SummaryOutputProducer::GenericSummary& S = idSummary.second;
1124  fprintf(out_file,
1125  "%d,+%.f,-%.f,~%.f,%s\n",
1126  this->json.configuration.events,
1127  S.gained().v,
1128  S.lost().v,
1129  S.changed().v,
1130  S.name.c_str());
1131  }
1132 
1133  fclose(out_file);
1134 
1135  return file_name;
1136  }
1137 
1138 public:
1140  bool storeCSV;
1141 
1142  SummaryOutputProducer(const JsonOutputProducer& _json, bool _storeROOT, bool _storeCSV)
1143  : json(_json), run(0), storeROOT(_storeROOT), storeCSV(_storeCSV) {}
1144 
1145  void write() {
1146  std::vector<std::string> filesCreated;
1147  // Processing every run from the JSON producer
1148  if (!json.m_run_events.empty()) {
1149  for (const auto& runEvents : json.m_run_events) {
1150  prepareSummaries(runEvents.first, runEvents.second);
1151  if (storeROOT) {
1152  filesCreated.push_back(writeHistograms());
1153  }
1154  if (storeCSV) {
1155  filesCreated.push_back(writeCSV_trigger());
1156  filesCreated.push_back(writeCSV_module());
1157  }
1158  }
1159  } else {
1160  if (storeROOT) {
1161  filesCreated.push_back(writeHistograms());
1162  }
1163  if (storeCSV) {
1164  filesCreated.push_back(writeCSV_trigger());
1165  filesCreated.push_back(writeCSV_module());
1166  }
1167  }
1168 
1169  if (!filesCreated.empty()) {
1170  std::cout << "Created the following summary files:" << std::endl;
1171  for (const std::string& filename : filesCreated)
1172  std::cout << " " << filename << std::endl;
1173  }
1174  }
1175 };
1176 
1178  std::unique_ptr<TFile> f(TFile::Open(file.c_str()));
1179  return (f and not f->IsZombie());
1180 }
1181 
1182 bool check_files(std::vector<std::string> const& files) {
1183  bool flag = true;
1184  for (auto const& file : files)
1185  if (not check_file(file)) {
1186  flag = false;
1187  std::cerr << "hltDiff: error: file " << file << " does not exist, or is not a regular file." << std::endl;
1188  }
1189  return flag;
1190 }
1191 
1192 class HltDiff {
1193 public:
1194  std::vector<std::string> old_files;
1196  std::vector<std::string> new_files;
1198  unsigned int max_events;
1200  bool csv_out;
1201  bool json_out;
1202  bool root_out;
1205  bool debug;
1206  bool quiet;
1207  unsigned int verbose;
1208 
1210  : old_files(0),
1211  old_process(""),
1212  new_files(0),
1213  new_process(""),
1214  max_events(1e9),
1215  ignore_prescales(true),
1216  csv_out(false),
1217  json_out(false),
1218  root_out(false),
1219  output_file(""),
1220  file_check(false),
1221  debug(false),
1222  quiet(false),
1223  verbose(0) {}
1224 
1225  void compare() const {
1226  std::shared_ptr<fwlite::ChainEvent> old_events;
1227  std::shared_ptr<fwlite::ChainEvent> new_events;
1228 
1229  if (not file_check or check_files(old_files))
1230  old_events = std::make_shared<fwlite::ChainEvent>(old_files);
1231  else
1232  return;
1233 
1234  if (new_files.size() == 1 and new_files[0] == "-")
1235  new_events = old_events;
1236  else if (not file_check or check_files(new_files))
1237  new_events = std::make_shared<fwlite::ChainEvent>(new_files);
1238  else
1239  return;
1240 
1241  // creating the structure holding data for JSON and ROOT output
1242  JsonOutputProducer json(json_out, output_file);
1243 
1244  json.configuration.prescales = ignore_prescales;
1245  // setting the old configuration
1246  json.configuration.o.process = old_process;
1247  json.configuration.o.files = old_files;
1248  json.configuration.o.extractFileBase();
1249  // setting the new configuration
1250  json.configuration.n.process = new_process;
1251  json.configuration.n.files = new_files;
1252  json.configuration.n.extractFileBase();
1253 
1254  // initialising configurations to be compared
1255  std::unique_ptr<HLTConfigDataEx> old_config_data;
1256  std::unique_ptr<HLTConfigDataEx> new_config_data;
1257  std::unique_ptr<HLTCommonConfig> common_config;
1258  HLTConfigInterface const* old_config = nullptr;
1259  HLTConfigInterface const* new_config = nullptr;
1260 
1261  unsigned int counter = 0;
1262  unsigned int skipped = 0;
1263  unsigned int affected = 0;
1264  bool new_run = true;
1265  std::vector<TriggerDiff> differences;
1266 
1267  // loop over the reference events
1268  const unsigned int nEvents = std::min((int)old_events->size(), (int)max_events);
1269  const unsigned int counter_denominator = std::max(1, int(nEvents / 10));
1270  for (old_events->toBegin(); not old_events->atEnd(); ++(*old_events)) {
1271  // printing progress on every 10%
1272  if (counter % (counter_denominator) == 0) {
1273  std::cout << "Processed events: " << counter << " out of " << nEvents << " ("
1274  << 10 * counter / (counter_denominator) << "%)" << std::endl;
1275  }
1276 
1277  // seek the same event in the "new" files
1278  edm::EventID const& id = old_events->id();
1279  if (new_events != old_events and not new_events->to(id)) {
1280  if (debug)
1281  std::cerr << "run " << id.run() << ", lumi " << id.luminosityBlock() << ", event " << id.event()
1282  << ": not found in the 'new' files, skipping." << std::endl;
1283  ++skipped;
1284  continue;
1285  }
1286 
1287  // read the TriggerResults and TriggerEvent
1289  edm::TriggerResults const* old_results = nullptr;
1290  old_results_h.getByLabel<fwlite::Event>(*old_events->event(), "TriggerResults", "", old_process.c_str());
1291  if (old_results_h.isValid())
1292  old_results = old_results_h.product();
1293  else {
1294  if (debug)
1295  std::cerr << "run " << id.run() << ", lumi " << id.luminosityBlock() << ", event " << id.event()
1296  << ": 'old' TriggerResults not found, skipping." << std::endl;
1297  continue;
1298  }
1299 
1301  trigger::TriggerEvent const* old_summary = nullptr;
1302  old_summary_h.getByLabel<fwlite::Event>(*old_events->event(), "hltTriggerSummaryAOD", "", old_process.c_str());
1303  if (old_summary_h.isValid())
1304  old_summary = old_summary_h.product();
1305 
1307  edm::TriggerResults const* new_results = nullptr;
1308  new_results_h.getByLabel<fwlite::Event>(*new_events->event(), "TriggerResults", "", new_process.c_str());
1309  if (new_results_h.isValid())
1310  new_results = new_results_h.product();
1311  else {
1312  if (debug)
1313  std::cerr << "run " << id.run() << ", lumi " << id.luminosityBlock() << ", event " << id.event()
1314  << ": 'new' TriggerResults not found, skipping." << std::endl;
1315  continue;
1316  }
1317 
1319  trigger::TriggerEvent const* new_summary = nullptr;
1320  new_summary_h.getByLabel<fwlite::Event>(*new_events->event(), "hltTriggerSummaryAOD", "", new_process.c_str());
1321  if (new_summary_h.isValid())
1322  new_summary = new_summary_h.product();
1323 
1324  // initialise the trigger configuration
1325  if (new_run) {
1326  new_run = false;
1327  old_events->fillParameterSetRegistry();
1328  new_events->fillParameterSetRegistry();
1329 
1330  old_config_data = getHLTConfigData(*old_events->event(), old_process);
1331  new_config_data = getHLTConfigData(*new_events->event(), new_process);
1332  if (new_config_data->triggerNames() == old_config_data->triggerNames()) {
1333  old_config = old_config_data.get();
1334  new_config = new_config_data.get();
1335  } else {
1336  common_config = std::make_unique<HLTCommonConfig>(*old_config_data, *new_config_data);
1337  old_config = &common_config->getView(HLTCommonConfig::Index::First);
1338  new_config = &common_config->getView(HLTCommonConfig::Index::Second);
1339  std::cout << "Warning: old and new TriggerResults come from different HLT menus. Only the common "
1340  << old_config->size() << " triggers are compared.\n"
1341  << std::endl;
1342  }
1343 
1344  differences.clear();
1345  differences.resize(old_config->size());
1346 
1347  // adding the list of selected triggers to JSON output
1348  std::vector<std::string> states_str;
1349  for (int i = State::Ready; i != State::Invalid; i++)
1350  states_str.push_back(std::string(path_state(static_cast<State>(i))));
1351  json.vars.state = states_str;
1352  for (size_t triggerId = 0; triggerId < old_config->size(); ++triggerId) {
1353  json.vars.trigger.push_back(old_config->triggerName(triggerId));
1354  json.vars.trigger_passed_count.push_back(std::pair<int, int>(0, 0));
1355  }
1356  // getting names of triggers existing only in the old configuration
1357  for (auto const& it : old_config_data->triggerNames()) {
1358  if (std::find(json.vars.trigger.begin(), json.vars.trigger.end(), it) != json.vars.trigger.end())
1359  continue;
1360  json.configuration.o.skipped_triggers.push_back(it);
1361  }
1362  // getting names of triggers existing only in the new configuration
1363  for (auto const& it : new_config_data->triggerNames()) {
1364  if (std::find(json.vars.trigger.begin(), json.vars.trigger.end(), it) != json.vars.trigger.end())
1365  continue;
1366  json.configuration.n.skipped_triggers.push_back(it);
1367  }
1368  }
1369 
1370  // compare the TriggerResults
1371  bool needs_header = true;
1372  bool event_affected = false;
1373  for (unsigned int p = 0; p < old_config->size(); ++p) {
1374  // FIXME explicitly converting the indices is a hack, it should be properly encapsulated instead
1375  unsigned int old_index = old_config->triggerIndex(p);
1376  unsigned int new_index = new_config->triggerIndex(p);
1377  State old_state = prescaled_state(old_results->state(old_index), p, old_results->index(old_index), *old_config);
1378  State new_state = prescaled_state(new_results->state(new_index), p, new_results->index(new_index), *new_config);
1379 
1380  if (old_state == Pass) {
1381  ++differences.at(p).count;
1382  }
1383  if (old_state == Pass)
1384  ++json.vars.trigger_passed_count.at(p).first;
1385  if (new_state == Pass)
1386  ++json.vars.trigger_passed_count.at(p).second;
1387 
1388  bool trigger_affected = false;
1389  if (not ignore_prescales or (old_state != Prescaled and new_state != Prescaled)) {
1390  if (old_state == Pass and new_state != Pass) {
1391  ++differences.at(p).lost;
1392  trigger_affected = true;
1393  } else if (old_state != Pass and new_state == Pass) {
1394  ++differences.at(p).gained;
1395  trigger_affected = true;
1396  } else if (old_results->index(old_index) != new_results->index(new_index)) {
1397  ++differences.at(p).internal;
1398  trigger_affected = true;
1399  }
1400  }
1401 
1402  if (not trigger_affected)
1403  continue;
1404 
1405  event_affected = true;
1406  const unsigned int old_moduleIndex = old_results->index(old_index);
1407  const unsigned int new_moduleIndex = new_results->index(new_index);
1408  // storing the event to JSON, without any trigger results for the moment
1409  JsonOutputProducer::JsonEvent& event = json.pushEvent(id.run(), id.luminosityBlock(), id.event());
1410  JsonOutputProducer::JsonTriggerEventState& state = event.pushTrigger(p);
1411  state.o = json.eventState(old_state,
1412  old_moduleIndex,
1413  old_config->moduleLabel(p, old_moduleIndex),
1414  old_config->moduleType(p, old_moduleIndex));
1415  state.n = json.eventState(new_state,
1416  new_moduleIndex,
1417  new_config->moduleLabel(p, new_moduleIndex),
1418  new_config->moduleType(p, new_moduleIndex));
1419 
1420  if (verbose > 0) {
1421  if (needs_header) {
1422  needs_header = false;
1423  std::cout << "run " << id.run() << ", lumi " << id.luminosityBlock() << ", event " << id.event() << ": "
1424  << "old result is '" << event_state(old_results->accept()) << "', "
1425  << "new result is '" << event_state(new_results->accept()) << "'" << std::endl;
1426  }
1427  // print the Trigger path and filter responsible for the discrepancy
1428  std::cout << " Path " << old_config->triggerName(p) << ":\n"
1429  << " old state is ";
1430  print_detailed_path_state(std::cout, old_state, p, old_moduleIndex, *old_config);
1431  std::cout << ",\n"
1432  << " new state is ";
1433  print_detailed_path_state(std::cout, new_state, p, new_moduleIndex, *new_config);
1434  std::cout << std::endl;
1435  }
1436  if (verbose > 1 and old_summary and new_summary) {
1437  // print TriggerObjects for the filter responsible for the discrepancy
1438  unsigned int module = std::min(old_moduleIndex, new_moduleIndex);
1439  std::cout << " Filter " << old_config->moduleLabel(p, module) << ":\n";
1440  std::cout << " old trigger candidates:\n";
1442  *old_summary,
1443  edm::InputTag(old_config->moduleLabel(p, module), "", old_config->processName()));
1444  std::cout << " new trigger candidates:\n";
1446  *new_summary,
1447  edm::InputTag(new_config->moduleLabel(p, module), "", new_config->processName()));
1448  }
1449  if (verbose > 0)
1450  std::cout << std::endl;
1451  }
1452  if (event_affected)
1453  ++affected;
1454 
1455  // compare the TriggerEvent
1456  if (event_affected and verbose > 2 and old_summary and new_summary) {
1457  std::map<std::string, std::pair<std::string, std::string>> collections;
1458  for (auto const& old_collection : old_summary->collectionTags())
1459  collections[strip_process_name(old_collection)].first = old_collection;
1460  for (auto const& new_collection : new_summary->collectionTags())
1461  collections[strip_process_name(new_collection)].second = new_collection;
1462 
1463  for (auto const& collection : collections) {
1464  std::cout << " Collection " << collection.first << ":\n";
1465  std::cout << " old trigger candidates:\n";
1466  print_trigger_collection(std::cout, *old_summary, collection.second.first);
1467  std::cout << " new trigger candidates:\n";
1468  print_trigger_collection(std::cout, *new_summary, collection.second.second);
1469  std::cout << std::endl;
1470  }
1471  }
1472 
1473  ++counter;
1474  if (nEvents and counter >= nEvents)
1475  break;
1476  }
1477 
1478  json.configuration.events = counter;
1479 
1480  if (not counter) {
1481  std::cout << "There are no common events between the old and new files";
1482  if (skipped)
1483  std::cout << ", " << skipped << " events were skipped";
1484  std::cout << "." << std::endl;
1485  } else {
1486  std::cout << "Found " << counter << " matching events, out of which " << affected
1487  << " have different HLT results";
1488  if (skipped)
1489  std::cout << ", " << skipped << " events were skipped";
1490  std::cout << "\n" << std::endl;
1491  }
1492  // Printing the summary of affected triggers with affected-event counts
1493  if (!quiet) {
1494  bool summaryHeaderPrinted = false;
1495  for (size_t p = 0; p < old_config->size(); ++p) {
1496  if (differences.at(p).total() < 1)
1497  continue;
1498  if (!summaryHeaderPrinted)
1499  std::cout << std::setw(12) << "Events" << std::setw(12) << "Accepted" << std::setw(12) << "Gained"
1500  << std::setw(12) << "Lost" << std::setw(12) << "Other"
1501  << " "
1502  << "Trigger" << std::endl;
1503  std::cout << std::setw(12) << counter << differences.at(p) << " " << old_config->triggerName(p) << std::endl;
1504  summaryHeaderPrinted = true;
1505  }
1506  }
1507 
1508  // writing all the required output
1509  json.write(); // to JSON file for interactive visualisation
1510  SummaryOutputProducer summary(json, this->root_out, this->csv_out);
1511  summary.write(); // to ROOT file for fast validation with static plots
1512  }
1513 
1514  void usage(std::ostream& out) const {
1515  out << "\
1516 usage: hltDiff -o|--old-files FILE1.ROOT [FILE2.ROOT ...] [-O|--old-process LABEL[:INSTANCE[:PROCESS]]]\n\
1517  -n|--new-files FILE1.ROOT [FILE2.ROOT ...] [-N|--new-process LABEL[:INSTANCE[:PROCESS]]]\n\
1518  [-m|--max-events MAXEVENTS] [-p|--prescales] [-c|--csv-output] [-j|--json-output]\n\
1519  [-r|--root-output] [-f|--file-check] [-d|--debug] [-q|--quiet] [-v|--verbose]\n\
1520  [-h|--help] [-F|--output-file] FILE_NAME\n\
1521 \n\
1522  -o|--old-files FILE1.ROOT [FILE2.ROOT ...]\n\
1523  input file(s) with the old (reference) trigger results\n\
1524 \n\
1525  -O|--old-process PROCESS\n\
1526  process name of the collection with the old (reference) trigger results\n\
1527  default: take the 'TriggerResults' from the last process\n\
1528 \n\
1529  -n|--new-files FILE1.ROOT [FILE2.ROOT ...]\n\
1530  input file(s) with the new trigger results to be compared with the reference\n\
1531  to read these from a different collection in the same files as\n\
1532  the reference, use '-n -' and specify the collection with -N (see below)\n\
1533 \n\
1534  -N|--new-process PROCESS\n\
1535  process name of the collection with the new (reference) trigger results\n\
1536  default: take the 'TriggerResults' from the last process\n\
1537 \n\
1538  -m|--max-events MAXEVENTS\n\
1539  compare only the first MAXEVENTS events\n\
1540  default: compare all the events in the original (reference) files\n\
1541 \n\
1542  -p|--prescales\n\
1543  do not ignore differences caused by HLTPrescaler modules\n\
1544 \n\
1545  -c|--csv-output\n\
1546  produce comparison results in a CSV format\n\
1547 \n\
1548  -j|--json-output\n\
1549  produce comparison results in a JSON format\n\
1550 \n\
1551  -r|--root-output\n\
1552  produce comparison results as histograms in a ROOT file\n\
1553 \n\
1554  -F|--output-file FILE_NAME\n\
1555  combine all RUNs to files with the specified custom name: FILE_NAME.json, FILE_NAME.root\n\
1556  default: a separate output file will be produced for each RUN with names suitable for the DQM GUI\n\
1557 \n\
1558  -f|--file-check\n\
1559  check existence of every old and new file before running the comparison\n\
1560  safer if files are run for the first time, but can cause a substantial delay\n\
1561 \n\
1562  -d|--debug\n\
1563  display messages about missing events and collectiions\n\
1564 \n\
1565  -q|--quiet\n\
1566  don't display summary printout with the list of affected trigger paths\n\
1567 \n\
1568  -v|--verbose LEVEL\n\
1569  set verbosity level:\n\
1570  1: event-by-event comparison results\n\
1571  2: + print the trigger candidates of the affected filters\n\
1572  3: + print all the trigger candidates for the affected events\n\
1573  default: 1\n\
1574 \n\
1575  -h|--help\n\
1576  print this help message, and exit"
1577  << std::endl;
1578  }
1579 };
1580 
1581 int main(int argc, char** argv) {
1582  // options
1583  const char optstring[] = "dfo:O:n:N:m:pcjrF:v::hq";
1584  const option longopts[] = {
1585  option{"debug", no_argument, nullptr, 'd'},
1586  option{"file-check", no_argument, nullptr, 'f'},
1587  option{"old-files", required_argument, nullptr, 'o'},
1588  option{"old-process", required_argument, nullptr, 'O'},
1589  option{"new-files", required_argument, nullptr, 'n'},
1590  option{"new-process", required_argument, nullptr, 'N'},
1591  option{"max-events", required_argument, nullptr, 'm'},
1592  option{"prescales", no_argument, nullptr, 'p'},
1593  option{"csv-output", optional_argument, nullptr, 'c'},
1594  option{"json-output", optional_argument, nullptr, 'j'},
1595  option{"root-output", optional_argument, nullptr, 'r'},
1596  option{"output-file", optional_argument, nullptr, 'F'},
1597  option{"verbose", optional_argument, nullptr, 'v'},
1598  option{"help", no_argument, nullptr, 'h'},
1599  option{"quiet", no_argument, nullptr, 'q'},
1600  };
1601 
1602  // Creating an HltDiff object with the default configuration
1603  auto hlt = new HltDiff();
1604 
1605  // parse the command line options
1606  int c = -1;
1607  while ((c = getopt_long(argc, argv, optstring, longopts, nullptr)) != -1) {
1608  switch (c) {
1609  case 'd':
1610  hlt->debug = true;
1611  break;
1612 
1613  case 'f':
1614  hlt->file_check = true;
1615  break;
1616 
1617  case 'o':
1618  hlt->old_files.emplace_back(optarg);
1619  while (optind < argc) {
1620  if (argv[optind][0] == '-')
1621  break;
1622  hlt->old_files.emplace_back(argv[optind]);
1623  ++optind;
1624  }
1625  break;
1626 
1627  case 'O':
1628  hlt->old_process = optarg;
1629  break;
1630 
1631  case 'n':
1632  hlt->new_files.emplace_back(optarg);
1633  while (optind < argc) {
1634  if (argv[optind][0] == '-')
1635  break;
1636  hlt->new_files.emplace_back(argv[optind]);
1637  ++optind;
1638  }
1639  break;
1640 
1641  case 'N':
1642  hlt->new_process = optarg;
1643  break;
1644 
1645  case 'm':
1646  hlt->max_events = atoi(optarg);
1647  break;
1648 
1649  case 'p':
1650  hlt->ignore_prescales = false;
1651  break;
1652 
1653  case 'c':
1654  hlt->csv_out = true;
1655  break;
1656 
1657  case 'j':
1658  hlt->json_out = true;
1659  break;
1660 
1661  case 'r':
1662  hlt->root_out = true;
1663  break;
1664 
1665  case 'F':
1666  hlt->output_file = optarg;
1667  break;
1668 
1669  case 'v':
1670  hlt->verbose = 1;
1671  if (optarg) {
1672  hlt->verbose = std::max(1, atoi(optarg));
1673  } else if (!optarg && nullptr != argv[optind] && '-' != argv[optind][0]) {
1674  // workaround for a bug in getopt which doesn't allow space before optional arguments
1675  const char* tmp_optarg = argv[optind++];
1676  hlt->verbose = std::max(1, atoi(tmp_optarg));
1677  }
1678  break;
1679 
1680  case 'h':
1681  hlt->usage(std::cerr);
1682  exit(0);
1683  break;
1684 
1685  case 'q':
1686  hlt->quiet = true;
1687  break;
1688 
1689  default:
1690  error(std::cerr);
1691  exit(1);
1692  break;
1693  }
1694  }
1695 
1696  if (hlt->old_files.empty()) {
1697  error(std::cerr, "hltDiff: please specify the 'old' file(s)");
1698  exit(1);
1699  }
1700  if (hlt->new_files.empty()) {
1701  error(std::cerr, "hltDiff: please specify the 'new' file(s)");
1702  exit(1);
1703  }
1704 
1705  hlt->compare();
1706 
1707  return 0;
1708 }
HltDiff::csv_out
bool csv_out
Definition: hltDiff.cc:1200
trigger::TriggerObject::phi
float phi() const
Definition: TriggerObject.h:54
edm::pset::Registry::instance
static Registry * instance()
Definition: Registry.cc:12
JsonOutputProducer::JsonTriggerEventState::serialise
std::string serialise(size_t _indent=0) const
Definition: hltDiff.cc:646
change_name.diff
diff
Definition: change_name.py:13
JsonOutputProducer::JsonEventState::JsonEventState
JsonEventState(State _s, int _m, int _l, int _t)
Definition: hltDiff.cc:638
HLTConfigDataEx::moduleTypeSet_
std::set< std::string > moduleTypeSet_
Definition: hltDiff.cc:109
JsonOutputProducer::tab_spaces
static size_t tab_spaces
Definition: hltDiff.cc:423
counter
Definition: counter.py:1
JsonOutputProducer::JsonVars
Definition: hltDiff.cc:566
HLTConfigDataEx::~HLTConfigDataEx
~HLTConfigDataEx() override=default
cmsBatch.argv
argv
Definition: cmsBatch.py:279
HLTConfigDataEx::processName
std::string const & processName() const override
Definition: hltDiff.cc:83
HltDiff::usage
void usage(std::ostream &out) const
Definition: hltDiff.cc:1514
HltDiff::json_out
bool json_out
Definition: hltDiff.cc:1201
mps_fire.i
i
Definition: mps_fire.py:355
JsonOutputProducer::JsonConfiguration::events
int events
Definition: hltDiff.cc:544
HLTConfigData::moduleType
const std::string moduleType(const std::string &module) const
C++ class name of module.
Definition: HLTConfigData.cc:480
JsonOutputProducer::key_int
static std::string key_int(const std::string &_key, int _int, const std::string &_delim="")
Definition: hltDiff.cc:456
funct::false
false
Definition: Factorize.h:34
HLTCommonConfig::View::prescaler
bool prescaler(unsigned int trigger, unsigned int module) const override
Definition: hltDiff.cc:238
Handle.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
JsonOutputProducer::indent
static std::string indent(size_t _nTabs)
Definition: hltDiff.cc:426
JsonOutputProducer::JsonTriggerEventState::tr
int tr
Definition: hltDiff.cc:642
Prescaled
Definition: hltDiff.cc:247
TriggerResults.h
TriggerDiff::count
unsigned int count
Definition: hltDiff.cc:389
JsonOutputProducer::JsonConfigurationBlock::file_base
std::string file_base
Definition: hltDiff.cc:493
SummaryOutputProducer::TriggerSummary
Definition: hltDiff.cc:857
SummaryOutputProducer::GenericSummary::name
std::string name
Definition: hltDiff.cc:820
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
SummaryOutputProducer::writeCSV_trigger
std::string writeCSV_trigger() const
Definition: hltDiff.cc:1088
HltDiff::output_file
std::string output_file
Definition: hltDiff.cc:1203
HLTConfigData
Definition: HLTConfigData.h:25
HLTConfigData::triggerNames
const std::vector< std::string > & triggerNames() const
names of trigger paths
Definition: HLTConfigData.cc:436
dir2webdir.argc
argc
Definition: dir2webdir.py:39
HLTCommonConfig::HLTCommonConfig
HLTCommonConfig(HLTConfigDataEx const &first, HLTConfigDataEx const &second)
Definition: hltDiff.cc:138
min
T min(T a, T b)
Definition: MathUtil.h:58
TriggerEvent.h
MicroEventContent_cff.branch
branch
Definition: MicroEventContent_cff.py:152
SummaryOutputProducer::storeROOT
bool storeROOT
Definition: hltDiff.cc:1139
HltDiff::compare
void compare() const
Definition: hltDiff.cc:1225
HLTCommonConfig::View::processName
std::string const & processName() const override
Definition: hltDiff.cc:216
JsonOutputProducer::JsonEventState
Definition: hltDiff.cc:617
JsonOutputProducer::m_run_events
std::map< int, std::vector< JsonEvent > > m_run_events
Definition: hltDiff.cc:696
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
event_state
const char * event_state(bool state)
Definition: hltDiff.cc:114
HLTCommonConfig::View::moduleLabel
std::string const & moduleLabel(unsigned int trigger, unsigned int module) const override
Definition: hltDiff.cc:230
HLTConfigDataEx::moduleType
std::string const & moduleType(unsigned int trigger, unsigned int module) const override
Definition: hltDiff.cc:99
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HLTCommonConfig::View::View
View(HLTCommonConfig const &config, HLTCommonConfig::Index index)
Definition: hltDiff.cc:122
HLTConfigDataEx::moduleLabel
std::string const & moduleLabel(unsigned int trigger, unsigned int module) const override
Definition: hltDiff.cc:95
SummaryOutputProducer::prepareSummaries
void prepareSummaries(const int _run, const std::vector< JsonOutputProducer::JsonEvent > &_events)
Definition: hltDiff.cc:921
JsonOutputProducer::JsonEvent::run
int run
Definition: hltDiff.cc:660
JsonOutputProducer::JsonVars::trigger
std::vector< std::string > trigger
Definition: hltDiff.cc:568
SummaryOutputProducer::TriggerSummary::lost
Pair lost(int type=0) const
Definition: hltDiff.cc:890
SummaryOutputProducer::TriggerSummary::addEntry
void addEntry(const JsonOutputProducer::JsonEvent &_event, const int _triggerIndex, const std::vector< std::string > &_moduleNames)
Definition: hltDiff.cc:867
SummaryOutputProducer::m_triggerSummary
std::map< int, TriggerSummary > m_triggerSummary
Definition: hltDiff.cc:918
HLTCommonConfig::prescaler
bool prescaler(Index index, unsigned int trigger, unsigned int module) const
Definition: hltDiff.cc:199
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
HLTConfigDataEx
Definition: hltDiff.cc:69
HLTCommonConfig::View::triggerName
std::string const & triggerName(unsigned int trigger) const override
Definition: hltDiff.cc:222
JsonOutputProducer::labelId
unsigned int labelId(std::string labelName)
Definition: hltDiff.cc:600
SummaryOutputProducer::GenericSummary::gained
Pair gained() const
Definition: hltDiff.cc:846
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
JsonOutputProducer::JsonConfigurationBlock::serialise
std::string serialise(size_t _indent=0) const
Definition: hltDiff.cc:498
HLTConfigData::processName
const std::string & processName() const
Accessors (const methods)
Definition: HLTConfigData.cc:427
JsonOutputProducer::vars
JsonVars vars
Definition: hltDiff.cc:597
HltDiff::debug
bool debug
Definition: hltDiff.cc:1205
HltDiff::ignore_prescales
bool ignore_prescales
Definition: hltDiff.cc:1199
trigger::TriggerEvent::collectionTags
const std::vector< std::string > & collectionTags() const
Definition: TriggerEvent.h:99
HLTConfigDataEx::triggerName
std::string const & triggerName(unsigned int trigger) const override
Definition: hltDiff.cc:91
SummaryOutputProducer::GenericSummary::lost
Pair lost() const
Definition: hltDiff.cc:848
SummaryOutputProducer::write
void write()
Definition: hltDiff.cc:1145
TriggerDiff::gained
unsigned int gained
Definition: hltDiff.cc:390
SummaryOutputProducer::Event
Definition: hltDiff.cc:808
cms::dd::split
std::vector< std::string_view > split(std::string_view, const char *)
HltDiff::new_process
std::string new_process
Definition: hltDiff.cc:1197
findQualityFiles.v
v
Definition: findQualityFiles.py:179
JsonOutputProducer::JsonEventState::s
State s
Definition: hltDiff.cc:618
JsonOutputProducer::JsonEvent::lumi
int lumi
Definition: hltDiff.cc:661
patZpeak.events
events
Definition: patZpeak.py:20
JsonOutputProducer::JsonConfiguration
Definition: hltDiff.cc:540
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::HLTGlobalStatus::state
hlt::HLTState state(const unsigned int i) const
Get status of ith path.
Definition: HLTGlobalStatus.h:68
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:87
SummaryOutputProducer::GenericSummary::addEntry
int addEntry(const JsonOutputProducer::JsonEvent &_event, const int _triggerIndex)
Definition: hltDiff.cc:830
dqmdumpme.first
first
Definition: dqmdumpme.py:55
HLTConfigDataEx::prescaler
bool prescaler(unsigned int trigger, unsigned int module) const override
Definition: hltDiff.cc:103
JsonOutputProducer::JsonConfiguration::serialise
std::string serialise(size_t _indent=0) const
Definition: hltDiff.cc:546
TriggerDiff::format
static std::string format(unsigned int value, char sign='+')
Definition: hltDiff.cc:394
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
HltDiff::max_events
unsigned int max_events
Definition: hltDiff.cc:1198
edm::Wrapper
Definition: Product.h:10
end
#define end
Definition: vmac.h:39
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
contentValuesCheck.file_name
file_name
Definition: contentValuesCheck.py:38
JsonOutputProducer::JsonConfigurationBlock::files
std::vector< std::string > files
Definition: hltDiff.cc:494
HLTCommonConfig::triggerName
std::string const & triggerName(Index index, unsigned int trigger) const
Definition: hltDiff.cc:171
edm::HLTGlobalStatus::index
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
Definition: HLTGlobalStatus.h:70
JsonOutputProducer::JsonConfigurationBlock::extractFileBase
void extractFileBase()
Definition: hltDiff.cc:512
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
HLTCommonConfig::View::~View
~View() override=default
JsonOutputProducer::JsonTriggerEventState::JsonTriggerEventState
JsonTriggerEventState(int _tr)
Definition: hltDiff.cc:656
SummaryOutputProducer::GenericSummary::keepForGL
bool keepForGL() const
Definition: hltDiff.cc:854
SummaryOutputProducer::Event::operator<
bool operator<(const Event &b) const
Definition: hltDiff.cc:814
config
Definition: config.py:1
HLTCommonConfig::processName
std::string const & processName(Index index) const
Definition: hltDiff.cc:155
JsonOutputProducer::JsonConfigurationBlock::JsonConfigurationBlock
JsonConfigurationBlock()
Definition: hltDiff.cc:537
hgcalDigitizer_cfi._m
_m
Definition: hgcalDigitizer_cfi.py:204
trigger::TriggerObject::pt
float pt() const
Definition: TriggerObject.h:52
alignCSCRings.s
s
Definition: alignCSCRings.py:92
SummaryOutputProducer::Pair::v
double v
Definition: hltDiff.cc:801
debug
#define debug
Definition: HDRShower.cc:19
JsonOutputProducer::JsonConfiguration::o
JsonConfigurationBlock o
Definition: hltDiff.cc:541
SummaryOutputProducer::GenericSummary::json
const JsonOutputProducer & json
Definition: hltDiff.cc:818
SummaryOutputProducer::GenericSummary
Definition: hltDiff.cc:817
fwlite::Handle
Definition: Handle.h:39
MainPageGenerator.files
files
Definition: MainPageGenerator.py:256
SummaryOutputProducer::GenericSummary::v_lost
std::set< Event > v_lost
Definition: hltDiff.cc:822
JsonOutputProducer::JsonEvent::serialise
std::string serialise(size_t _indent=0) const
Definition: hltDiff.cc:665
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
JsonOutputProducer::JsonTriggerEventState::o
JsonEventState o
Definition: hltDiff.cc:643
JsonOutputProducer::JsonEventState::serialise
std::string serialise(size_t _indent=0) const
Definition: hltDiff.cc:623
vars
vars
Definition: DeepTauId.cc:163
ChainEvent.h
JsonOutputProducer::JsonTriggerEventState::JsonTriggerEventState
JsonTriggerEventState()
Definition: hltDiff.cc:655
JsonOutputProducer::key
static std::string key(const std::string &_key, const std::string &_delim="")
Definition: hltDiff.cc:440
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
JsonOutputProducer::JsonEvent::JsonEvent
JsonEvent(int _run, int _lumi, int _event)
Definition: hltDiff.cc:681
HLTCommonConfig::triggerIndices_
std::vector< std::pair< unsigned int, unsigned int > > triggerIndices_
Definition: hltDiff.cc:213
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HLTConfigInterface::moduleType
virtual std::string const & moduleType(unsigned int trigger, unsigned int module) const =0
str
#define str(s)
Definition: TestProcessor.cc:48
Pass
Definition: hltDiff.cc:244
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
HLTConfigInterface::size
virtual unsigned int size() const =0
verbose
static constexpr int verbose
Definition: HLTExoticaSubAnalysis.cc:25
electronStore.output_file
output_file
Definition: electronStore.py:119
JsonOutputProducer::JsonEvent::pushTrigger
JsonTriggerEventState & pushTrigger(int _tr)
Definition: hltDiff.cc:683
JsonOutputProducer::eventState
JsonEventState eventState(State _s, int _m, const std::string &_l, const std::string &_t)
Definition: hltDiff.cc:719
looper.config
config
Definition: looper.py:291
JsonOutputProducer::JsonConfiguration::prescales
bool prescales
Definition: hltDiff.cc:543
OrderedSet.t
t
Definition: OrderedSet.py:90
SummaryOutputProducer::Pair::Pair
Pair(double _v, double _e)
Definition: hltDiff.cc:804
b
double b
Definition: hdecay.h:118
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
JsonOutputProducer::JsonVars::type
std::vector< std::string > type
Definition: hltDiff.cc:571
HLTCommonConfig::View::moduleType
std::string const & moduleType(unsigned int trigger, unsigned int module) const override
Definition: hltDiff.cc:234
JsonOutputProducer::JsonEvent::triggerStates
std::vector< JsonTriggerEventState > triggerStates
Definition: hltDiff.cc:663
trigger::TriggerObject
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
SummaryOutputProducer::GenericSummary::v_gained
std::set< Event > v_gained
Definition: hltDiff.cc:821
HLTCommonConfig::getView
View const & getView(Index index) const
Definition: hltDiff.cc:148
JsonOutputProducer::string
static std::string string(const std::string &_string, const std::string &_delim="")
Definition: hltDiff.cc:463
HLTCommonConfig::moduleLabel
std::string const & moduleLabel(Index index, unsigned int trigger, unsigned int module) const
Definition: hltDiff.cc:185
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SummaryOutputProducer::writeCSV_module
std::string writeCSV_module() const
Definition: hltDiff.cc:1117
oniaPATMuonsWithTrigger_cff.collections
collections
Definition: oniaPATMuonsWithTrigger_cff.py:37
error
void error(std::ostream &out)
Definition: hltDiff.cc:44
JsonOutputProducer::JsonVars::state
std::vector< std::string > state
Definition: hltDiff.cc:567
print_trigger_collection
void print_trigger_collection(std::ostream &out, trigger::TriggerEvent const &summary, std::string const &tag)
Definition: hltDiff.cc:328
SummaryOutputProducer::GenericSummary::GenericSummary
GenericSummary(int _id, const JsonOutputProducer &_json, const std::vector< std::string > &_names)
Definition: hltDiff.cc:825
funct::true
true
Definition: Factorize.h:173
JsonOutputProducer::pushEvent
JsonEvent & pushEvent(int _run, int _lumi, int _event)
Definition: hltDiff.cc:704
dqmiodumpindices.typeName
typeName
Definition: dqmiodumpindices.py:33
SummaryOutputProducer::Event::lumi
int lumi
Definition: hltDiff.cc:810
JsonOutputProducer::JsonConfigurationBlock
Definition: hltDiff.cc:492
edm::hlt::Fail
reject
Definition: HLTenums.h:19
edm::ParameterSet
Definition: ParameterSet.h:36
SummaryOutputProducer::TriggerSummary::gained
Pair gained(int type=0) const
Definition: hltDiff.cc:877
JsonOutputProducer::writeJson
bool writeJson
Definition: hltDiff.cc:488
HLTCommonConfig::View::config_
HLTCommonConfig const & config_
Definition: hltDiff.cc:134
main
int main(int argc, char **argv)
Definition: hltDiff.cc:1581
TriggerDiff::TriggerDiff
TriggerDiff()
Definition: hltDiff.cc:387
HLTCommonConfig::Index
Index
Definition: hltDiff.cc:118
ctppsRawToDigi_cff.configuration
configuration
Definition: ctppsRawToDigi_cff.py:11
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
getHLTConfigData
std::unique_ptr< HLTConfigDataEx > getHLTConfigData(fwlite::EventBase const &event, std::string process)
Definition: hltDiff.cc:363
Ready
Definition: hltDiff.cc:243
HltDiff
Definition: hltDiff.cc:1192
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
HltDiff::HltDiff
HltDiff()
Definition: hltDiff.cc:1209
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
SummaryOutputProducer::GenericSummary::v_changed
std::set< Event > v_changed
Definition: hltDiff.cc:823
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
hltrates_dqm_sourceclient-live_cfg.prescales
prescales
Definition: hltrates_dqm_sourceclient-live_cfg.py:90
HLTConfigInterface::prescaler
virtual bool prescaler(unsigned int trigger, unsigned int module) const =0
Exception
callgrindSwitch_cfi.lastEvent
lastEvent
Definition: callgrindSwitch_cfi.py:5
JsonOutputProducer::JsonEventState::m
int m
Definition: hltDiff.cc:619
trigger::TriggerObject::id
int id() const
getters
Definition: TriggerObject.h:51
State
State
Definition: RPixErrorChecker.h:15
HLTCommonConfig
Definition: hltDiff.cc:116
HLTConfigInterface::triggerName
virtual std::string const & triggerName(unsigned int trigger) const =0
HLTCommonConfig::size
unsigned int size(Index index) const
Definition: hltDiff.cc:162
HltDiff::new_files
std::vector< std::string > new_files
Definition: hltDiff.cc:1196
JsonOutputProducer::JsonTriggerEventState
Definition: hltDiff.cc:641
edm::hlt::Ready
not [yet] run
Definition: HLTenums.h:17
createfilelist.int
int
Definition: createfilelist.py:10
strip_process_name
std::string strip_process_name(std::string const &s)
Definition: hltDiff.cc:273
TriggerNames.h
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
edmLumisInFiles.summary
summary
Definition: edmLumisInFiles.py:39
SummaryOutputProducer::GenericSummary::id
int id
Definition: hltDiff.cc:819
getProcessNameFromBranch
std::string getProcessNameFromBranch(std::string const &branch)
Definition: hltDiff.cc:357
HLTConfigDataEx::moduleTypes_
std::vector< std::vector< std::string const * > > moduleTypes_
Definition: hltDiff.cc:110
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
JsonOutputProducer::JsonConfiguration::n
JsonConfigurationBlock n
Definition: hltDiff.cc:542
value
Definition: value.py:1
HltDiff::quiet
bool quiet
Definition: hltDiff.cc:1206
DeadROCCounter.out_file
out_file
Definition: DeadROCCounter.py:50
trigger::TriggerObject::eta
float eta() const
Definition: TriggerObject.h:53
JsonOutputProducer::useSingleOutFile
bool useSingleOutFile
Definition: hltDiff.cc:490
JsonOutputProducer::JsonConfigurationBlock::skipped_triggers
std::vector< std::string > skipped_triggers
Definition: hltDiff.cc:496
HLTConfigData::size
unsigned int size() const
number of trigger paths in trigger table
Definition: HLTConfigData.cc:431
fwlite::Handle::isValid
bool isValid() const
Definition: Handle.h:60
JsonOutputProducer::JsonConfigurationBlock::process
std::string process
Definition: hltDiff.cc:495
HLTCommonConfig::second_
HLTConfigDataEx const & second_
Definition: hltDiff.cc:208
counter
static std::atomic< unsigned int > counter
Definition: SharedResourceNames.cc:15
print_trigger_candidates
void print_trigger_candidates(std::ostream &out, trigger::TriggerEvent const &summary, edm::InputTag const &filter)
Definition: hltDiff.cc:298
check_files
bool check_files(std::vector< std::string > const &files)
Definition: hltDiff.cc:1182
Invalid
Definition: hltDiff.cc:248
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
trigger::TriggerEvent
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
HLTConfigInterface
Definition: hltDiff.cc:56
HltDiff::old_files
std::vector< std::string > old_files
Definition: hltDiff.cc:1194
module
Definition: vlib.h:198
JsonOutputProducer::list_string
static std::string list_string(const std::vector< std::string > &_values, const std::string &_delim="")
Definition: hltDiff.cc:471
SummaryOutputProducer::json
const JsonOutputProducer & json
Definition: hltDiff.cc:797
HLTCommonConfig::secondView_
View secondView_
Definition: hltDiff.cc:211
HLTConfigDataEx::size
unsigned int size() const override
Definition: hltDiff.cc:85
SummaryOutputProducer::Pair
Definition: hltDiff.cc:800
HLTConfigDataEx::data_
HLTConfigData data_
Definition: hltDiff.cc:108
TriggerObject.h
HltDiff::old_process
std::string old_process
Definition: hltDiff.cc:1195
SummaryOutputProducer
Definition: hltDiff.cc:795
InputTag.h
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
fwlite::EventBase
Definition: EventBase.h:36
HLTConfigDataEx::size
unsigned int size(unsigned int trigger) const override
Definition: hltDiff.cc:87
JsonOutputProducer::output_filename_base
std::string output_filename_base(int _run) const
Definition: hltDiff.cc:723
HLTConfigDataEx::prescalers_
std::vector< std::vector< bool > > prescalers_
Definition: hltDiff.cc:111
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
SummaryOutputProducer::TriggerSummary::m_modules
std::map< int, GenericSummary > m_modules
Definition: hltDiff.cc:860
SummaryOutputProducer::TriggerSummary::accepted_o
int accepted_o
Definition: hltDiff.cc:858
SummaryOutputProducer::TriggerSummary::changed
Pair changed(int type=0) const
Definition: hltDiff.cc:903
Registry.h
fwlite::Handle::getByLabel
void getByLabel(const P &iP, const char *iModuleLabel, const char *iProductInstanceLabel=nullptr, const char *iProcessLabel=nullptr)
Definition: Handle.h:100
SummaryOutputProducer::Event::event
int event
Definition: hltDiff.cc:811
JsonOutputProducer::JsonVars::JsonVars
JsonVars()
Definition: hltDiff.cc:592
HLTConfigInterface::~HLTConfigInterface
virtual ~HLTConfigInterface()=default
HLTCommonConfig::View::index_
Index index_
Definition: hltDiff.cc:135
type
type
Definition: HCALResponse.h:21
JsonOutputProducer::JsonVars::serialise
std::string serialise(size_t _indent=0) const
Definition: hltDiff.cc:573
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
HLTCommonConfig::firstView_
View firstView_
Definition: hltDiff.cc:210
SummaryOutputProducer::run
int run
Definition: hltDiff.cc:798
JsonOutputProducer::JsonEventState::JsonEventState
JsonEventState()
Definition: hltDiff.cc:637
JsonOutputProducer::JsonVars::label
std::vector< std::string > label
Definition: hltDiff.cc:570
operator<<
std::ostream & operator<<(std::ostream &out, TriggerDiff diff)
Definition: hltDiff.cc:415
fwlite::Event
Definition: Event.h:87
SummaryOutputProducer::storeCSV
bool storeCSV
Definition: hltDiff.cc:1140
JsonOutputProducer::JsonEventState::t
int t
Definition: hltDiff.cc:621
print_detailed_path_state
void print_detailed_path_state(std::ostream &out, State state, int path, int module, HLTConfigInterface const &config)
Definition: hltDiff.cc:287
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
HLTConfigData.h
hltMonBTagIPClient_cfi.storeROOT
storeROOT
Definition: hltMonBTagIPClient_cfi.py:6
JsonOutputProducer
Definition: hltDiff.cc:421
TriggerDiff::total
unsigned int total() const
Definition: hltDiff.cc:412
Event.h
JsonOutputProducer::JsonVars::trigger_passed_count
std::vector< std::pair< int, int > > trigger_passed_count
Definition: hltDiff.cc:569
HLTCommonConfig::Index::Second
SummaryOutputProducer::SummaryOutputProducer
SummaryOutputProducer(const JsonOutputProducer &_json, bool _storeROOT, bool _storeCSV)
Definition: hltDiff.cc:1142
HLTCommonConfig::View
Definition: hltDiff.cc:120
JsonOutputProducer::JsonTriggerEventState::n
JsonEventState n
Definition: hltDiff.cc:644
JsonOutputProducer::JsonOutputProducer
JsonOutputProducer(bool _writeJson, std::string _file_name)
Definition: hltDiff.cc:699
HLTConfigData::moduleLabel
const std::string & moduleLabel(unsigned int trigger, unsigned int module) const
Definition: HLTConfigData.cc:461
util.rrClient.indent
indent
Definition: rrClient.py:41
SummaryOutputProducer::Event::run
int run
Definition: hltDiff.cc:809
HltDiff::root_out
bool root_out
Definition: hltDiff.cc:1202
path_state
const char * path_state(State state)
Definition: hltDiff.cc:251
Fail
Definition: hltDiff.cc:245
HLTCommonConfig::triggerIndex
unsigned int triggerIndex(Index index, unsigned int trigger) const
Definition: hltDiff.cc:178
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
HLTConfigDataEx::triggerIndex
unsigned int triggerIndex(unsigned int trigger) const override
Definition: hltDiff.cc:93
HltDiff::file_check
bool file_check
Definition: hltDiff.cc:1204
HLTCommonConfig::moduleType
std::string const & moduleType(Index index, unsigned int trigger, unsigned int module) const
Definition: hltDiff.cc:192
HLTCommonConfig::first_
HLTConfigDataEx const & first_
Definition: hltDiff.cc:207
HLTCommonConfig::View::size
unsigned int size() const override
Definition: hltDiff.cc:218
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::HLTGlobalStatus::accept
bool accept() const
Has at least one path accepted the event?
Definition: HLTGlobalStatus.h:49
S
Definition: CSCDBL1TPParametersExtended.h:16
internal
Definition: ROOTFilePB.pb.h:39
check_file
bool check_file(std::string const &file)
Definition: hltDiff.cc:1177
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HLTConfigInterface::processName
virtual std::string const & processName() const =0
JsonOutputProducer::configuration
JsonConfiguration configuration
Definition: hltDiff.cc:596
trigger
Definition: HLTPrescaleTableCond.h:8
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
HLTConfigDataEx::HLTConfigDataEx
HLTConfigDataEx(HLTConfigData data)
Definition: hltDiff.cc:71
HltDiff::verbose
unsigned int verbose
Definition: hltDiff.cc:1207
SummaryOutputProducer::m_moduleSummary
std::map< int, GenericSummary > m_moduleSummary
Definition: hltDiff.cc:919
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
JsonOutputProducer::typeId
unsigned int typeId(std::string typeName)
Definition: hltDiff.cc:608
HLTConfigInterface::triggerIndex
virtual unsigned int triggerIndex(unsigned int trigger) const =0
HLTCommonConfig::size
unsigned int size(Index index, unsigned int trigger) const
Definition: hltDiff.cc:164
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
JsonOutputProducer::write
void write()
Definition: hltDiff.cc:737
TriggerDiff
Definition: hltDiff.cc:386
edm::hlt::Exception
error
Definition: HLTenums.h:20
SummaryOutputProducer::Event::Event
Event(int _run, int _lumi, int _event)
Definition: hltDiff.cc:813
writedatasetfile.max_events
max_events
Definition: writedatasetfile.py:27
runEdmFileComparison.skipped
skipped
Definition: runEdmFileComparison.py:225
edm::hlt::Pass
accept
Definition: HLTenums.h:18
event
Definition: event.py:1
edm::EventID
Definition: EventID.h:31
SummaryOutputProducer::TriggerSummary::TriggerSummary
TriggerSummary(int _id, const JsonOutputProducer &_json)
Definition: hltDiff.cc:862
SummaryOutputProducer::GenericSummary::changed
Pair changed() const
Definition: hltDiff.cc:850
nEvents
UInt_t nEvents
Definition: hcalCalib.cc:41
JsonOutputProducer::key_string
static std::string key_string(const std::string &_key, const std::string &_string, const std::string &_delim="")
Definition: hltDiff.cc:448
SummaryOutputProducer::Pair::Pair
Pair(int _v, int _e)
Definition: hltDiff.cc:805
crabWrapper.key
key
Definition: crabWrapper.py:19
lumi
Definition: LumiSectionData.h:20
SummaryOutputProducer::Pair::e
double e
Definition: hltDiff.cc:802
HLTCommonConfig::Index::First
JsonOutputProducer::JsonEventState::l
int l
Definition: hltDiff.cc:620
SummaryOutputProducer::writeHistograms
std::string writeHistograms() const
Definition: hltDiff.cc:944
event
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of "!*" before the partial wildcard feature was incorporated). The per-event "cost" of each negative criterion with multiple relevant triggers is about the same as ! *was in the past
HLTConfigData::triggerName
const std::string & triggerName(unsigned int triggerIndex) const
Definition: HLTConfigData.cc:437
json
nlohmann::json json
Definition: FastTimerService.cc:19
edm::pset::Registry::getMapped
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:17
HLTCommonConfig::View::triggerIndex
unsigned int triggerIndex(unsigned int trigger) const override
Definition: hltDiff.cc:226
HLT_2018_cff.fraction
fraction
Definition: HLT_2018_cff.py:51317
fwlite::Handle::product
T const * product() const
Definition: Handle.h:65
trigger::TriggerObject::mass
float mass() const
Definition: TriggerObject.h:55
edm::InputTag
Definition: InputTag.h:15
begin
#define begin
Definition: vmac.h:32
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::TriggerResults
Definition: TriggerResults.h:35
HLTConfigInterface::moduleLabel
virtual std::string const & moduleLabel(unsigned int trigger, unsigned int module) const =0
edm::ProcessConfiguration
Definition: ProcessConfiguration.h:14
SummaryOutputProducer::GenericSummary::keepForC
bool keepForC() const
Definition: hltDiff.cc:852
prescaled_state
State prescaled_state(int state, int path, int module, HLTConfigInterface const &config)
Definition: hltDiff.cc:260
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
TriggerDiff::lost
unsigned int lost
Definition: hltDiff.cc:391
JsonOutputProducer::out_filename_base
std::string out_filename_base
Definition: hltDiff.cc:489
JsonOutputProducer::JsonConfiguration::JsonConfiguration
JsonConfiguration()
Definition: hltDiff.cc:563
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
JsonOutputProducer::JsonEvent::event
int event
Definition: hltDiff.cc:662
ValidationMatrix.hlt
hlt
Definition: ValidationMatrix.py:459
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
HLTConfigDataEx::triggerNames
virtual std::vector< std::string > const & triggerNames() const
Definition: hltDiff.cc:89
JsonOutputProducer::JsonEvent
Definition: hltDiff.cc:659
SummaryOutputProducer::TriggerSummary::accepted_n
int accepted_n
Definition: hltDiff.cc:859