CMS 3D CMS Logo

L1TriggerScalerESAnalyzer.cc
Go to the documentation of this file.
1 #include <stdexcept>
2 #include <string>
3 #include <iostream>
4 #include <map>
11 
13 
15 
16 namespace edmtest {
17  class L1TriggerScalerESAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
18  public:
22  edm::LogVerbatim("L1TriggerScaler") << "L1TriggerScalerESAnalyzer";
23  }
27  edm::LogVerbatim("L1TriggerScaler") << "L1TriggerScalerESAnalyzer " << i;
28  }
29  ~L1TriggerScalerESAnalyzer() override { edm::LogVerbatim("L1TriggerScaler") << "~L1TriggerScalerESAnalyzer "; }
30  void beginJob() override;
31  void beginRun(const edm::Run&, const edm::EventSetup& context) override;
32  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
33  void endRun(const edm::Run&, const edm::EventSetup& context) override {}
34 
35  private:
38  };
39 
41  edm::LogVerbatim("L1TriggerScaler") << "###L1TriggerScalerESAnalyzer::beginRun";
42  const edm::ESHandle<L1TriggerScaler>& L1TriggerScaler_lumiarray = context.getHandle(scaler1Token_);
43  edm::LogVerbatim("L1TriggerScaler") << " got eshandle with flag " << L1TriggerScaler_lumiarray.isValid()
44  << " got data";
45  }
46 
48  edm::LogVerbatim("L1TriggerScaler") << "###L1TriggerScalerESAnalyzer::beginJob";
49  }
50 
52  using namespace edm::eventsetup;
53  edm::LogVerbatim("L1TriggerScaler") << "###L1TriggerScalerESAnalyzer::analyze";
54 
55  // Context is not used.
56  edm::LogVerbatim("L1TriggerScaler") << " I AM IN RUN NUMBER " << e.id().run();
57  edm::LogVerbatim("L1TriggerScaler") << " ---EVENT NUMBER " << e.id().event();
61  //record not found
62  edm::LogVerbatim("L1TriggerScaler") << "Record \"L1TriggerScalerRcd"
63  << "\" does not exist ";
64  }
65  const edm::ESHandle<L1TriggerScaler>& l1tr = context.getHandle(scaler2Token_);
66  edm::LogVerbatim("L1TriggerScaler") << " got eshandle\n got context";
67  const L1TriggerScaler* l1lumiscaler = l1tr.product();
68  edm::LogVerbatim("L1TriggerScaler") << "got L1TriggerScaler* ";
69 
70  edm::LogVerbatim("L1TriggerScaler") << "print result";
71  l1lumiscaler->printRunValue();
72  l1lumiscaler->printLumiSegmentValues();
73  l1lumiscaler->printFormat();
74  l1lumiscaler->printGTAlgoCounts();
75  l1lumiscaler->printGTAlgoRates();
76  l1lumiscaler->printGTAlgoPrescaling();
77  l1lumiscaler->printGTTechCounts();
78  l1lumiscaler->printGTTechRates();
79  l1lumiscaler->printGTTechPrescaling();
80  l1lumiscaler->printGTPartition0TriggerCounts();
81  l1lumiscaler->printGTPartition0TriggerRates();
82  l1lumiscaler->printGTPartition0DeadTime();
83  l1lumiscaler->printGTPartition0DeadTimeRatio();
84  edm::LogVerbatim("L1TriggerScaler") << "print finished";
85  }
87 } // namespace edmtest
void printGTTechCounts() const
Log< level::Info, true > LogVerbatim
const edm::ESGetToken< L1TriggerScaler, L1TriggerScalerRcd > scaler1Token_
void printRunValue() const
void printGTPartition0TriggerRates() const
void printGTPartition0TriggerCounts() const
void printGTPartition0DeadTimeRatio() const
void printGTAlgoPrescaling() const
const edm::ESGetToken< L1TriggerScaler, L1TriggerScalerRcd > scaler2Token_
L1TriggerScalerESAnalyzer(edm::ParameterSet const &p)
void printGTAlgoRates() const
T const * product() const
Definition: ESHandle.h:86
void printGTTechRates() const
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Transition
Definition: Transition.h:12
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void beginRun(const edm::Run &, const edm::EventSetup &context) override
bool isValid() const
Definition: ESHandle.h:44
void printFormat() const
void printGTPartition0DeadTime() const
void printLumiSegmentValues() const
heterocontainer::HCTypeTag TypeTag
HLT enums.
void printGTAlgoCounts() const
void endRun(const edm::Run &, const edm::EventSetup &context) override
void printGTTechPrescaling() const
Definition: Run.h:45
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:121