Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-28 03:09:56

0001 #include "FWCore/Framework/interface/Frameworkfwd.h"
0002 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0003 #include "FWCore/Framework/interface/MakerMacros.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/Utilities/interface/StreamID.h"
0007 
0008 #include <string>
0009 
0010 namespace edmtest {
0011 
0012   class UTC_Q1 : public edm::global::EDAnalyzer<> {
0013   public:
0014     explicit UTC_Q1(edm::ParameterSet const& p) {
0015       identifier = p.getUntrackedParameter<int>("identifier", 99);
0016       edm::GroupLogStatistics("timer");  // these lines would normally be in
0017       edm::GroupLogStatistics("trace");  // whatever service knows that
0018                                          // timer and trace should be groupd
0019                                          // by moduels for statistics
0020     }
0021 
0022     void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const override;
0023 
0024   private:
0025     int identifier;
0026   };
0027 
0028   void UTC_Q1::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const {
0029     edm::LogInfo("cat_A") << "Q1 with identifier " << identifier;
0030     edm::LogInfo("timer") << "Q1 timer with identifier " << identifier;
0031     edm::LogInfo("trace") << "Q1 trace with identifier " << identifier;
0032   }
0033 
0034   class UTC_Q2 : public edm::global::EDAnalyzer<> {
0035   public:
0036     explicit UTC_Q2(edm::ParameterSet const& p) { identifier = p.getUntrackedParameter<int>("identifier", 98); }
0037 
0038     void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const override;
0039 
0040   private:
0041     int identifier;
0042   };
0043 
0044   void UTC_Q2::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const {
0045     edm::LogInfo("cat_A") << "Q2 with identifier " << identifier;
0046     edm::LogInfo("timer") << "Q2 timer with identifier " << identifier;
0047     edm::LogInfo("trace") << "Q2 trace with identifier " << identifier;
0048   }
0049 
0050 }  // namespace edmtest
0051 
0052 using edmtest::UTC_Q1;
0053 using edmtest::UTC_Q2;
0054 DEFINE_FWK_MODULE(UTC_Q1);
0055 DEFINE_FWK_MODULE(UTC_Q2);