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>
9 
11 
13 
15 
16 using namespace std;
17 
18 
19 
20 
21 
22 namespace edmtest
23 {
25  {
26  public:
28  {
29  std::cout<<"L1TriggerScalerESAnalyzer"<<std::endl;
30  }
32  { std::cout<<"L1TriggerScalerESAnalyzer "<<i<<std::endl; }
34  std::cout<<"~L1TriggerScalerESAnalyzer "<<std::endl;
35  }
36  virtual void beginJob();
37  virtual void beginRun(const edm::Run&, const edm::EventSetup& context);
38  virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
39  private:
40  };
41 
42 
43  void
44  L1TriggerScalerESAnalyzer::beginRun(const edm::Run&, const edm::EventSetup& context){
45  std::cout<<"###L1TriggerScalerESAnalyzer::beginRun"<<std::endl;
46  edm::ESHandle<L1TriggerScaler> L1TriggerScaler_lumiarray;
47  std::cout<<"got eshandle"<<std::endl;
48  context.get<L1TriggerScalerRcd>().get(L1TriggerScaler_lumiarray);
49  std::cout<<"got data"<<std::endl;
50  }
51 
52  void
54  std::cout<<"###L1TriggerScalerESAnalyzer::beginJob"<<std::endl;
55 
56  }
57 
58 
59  void
61  using namespace edm::eventsetup;
62  std::cout<<"###L1TriggerScalerESAnalyzer::analyze"<<std::endl;
63 
64  // Context is not used.
65  std::cout <<" I AM IN RUN NUMBER "<<e.id().run() <<std::endl;
66  std::cout <<" ---EVENT NUMBER "<<e.id().event() <<std::endl;
69  //record not found
70  std::cout <<"Record \"L1TriggerScalerRcd"<<"\" does not exist "<<std::endl;
71  }
73  std::cout<<"got eshandle"<<std::endl;
74  context.get<L1TriggerScalerRcd>().get(l1tr);
75  std::cout<<"got context"<<std::endl;
76  const L1TriggerScaler* l1lumiscaler=l1tr.product();
77  std::cout<<"got L1TriggerScaler* "<< std::endl;
78 
79  /* let's user the printValues method
80  std::cout<< "print result" << std::endl;
81  l1lumiscaler->printAllValues();
82  std::cout<< "print finished" << std::endl;
83  */
84 std::cout<< "print result" << std::endl;
85  l1lumiscaler->printRunValue();
86  l1lumiscaler->printLumiSegmentValues();
87  l1lumiscaler->printFormat();
88  l1lumiscaler->printGTAlgoCounts();
89  l1lumiscaler->printGTAlgoRates();
90  l1lumiscaler->printGTAlgoPrescaling();
91  l1lumiscaler->printGTTechCounts();
92  l1lumiscaler->printGTTechRates();
93  l1lumiscaler->printGTTechPrescaling();
94  l1lumiscaler->printGTPartition0TriggerCounts();
95  l1lumiscaler->printGTPartition0TriggerRates();
96  l1lumiscaler->printGTPartition0DeadTime();
97  l1lumiscaler->printGTPartition0DeadTimeRatio();
98  std::cout<< "print finished" << std::endl;
99 
100 
101 
102  /*
103  for(std::vector<L1TriggerScaler::Lumi>::const_iterator it=l1lumiscaler->m_run.begin(); it!=l1lumiscaler->m_run.end(); ++it){
104  std::cout << " run: " <<it->m_rn<<
105  "\nlumisegment: " << it->m_lumisegment<<std::endl;
106 
107 
108 
109  for(size_t i=0; i<it->m_GTAlgoRates.size(); i++ ){
110  std::cout << "m_GTAlgoRates["<<i<<"] = "<< it->m_GTAlgoRates[i]<<std::endl;
111  }
112  for(size_t i=0; i<it->m_GTAlgoPrescaling.size(); i++ ){
113  std::cout << "m_GTAlgoPrescaling["<<i<<"] = "<< it->m_GTAlgoPrescaling[i]<<std::endl;
114  }
115 for(size_t i=0; i<it->m_GTTechCounts.size(); i++ ){
116  std::cout << " m_GTTechCounts["<<i<<"] = "<< it->m_GTTechCounts[i]<<std::endl;
117  }
118 
119 for(size_t i=0; i<it->m_GTTechRates.size(); i++ ){
120  std::cout << " m_GTTechRates["<<i<<"] = "<< it->m_GTTechRates[i]<<std::endl;
121  }
122 for(size_t i=0; i<it->m_GTTechPrescaling.size(); i++ ){
123  std::cout << " m_GTTechPrescaling["<<i<<"] = "<< it->m_GTTechPrescaling[i]<<std::endl;
124  }
125 for(size_t i=0; i<it->m_GTPartition0TriggerCounts.size(); i++ ){
126  std::cout << " m_GTPartition0TriggerCounts["<<i<<"] = "<< it->m_GTPartition0TriggerCounts[i]<<std::endl;
127  }
128 for(size_t i=0; i<it->m_GTPartition0TriggerRates.size(); i++ ){
129  std::cout << " m_GTPartition0TriggerRates["<<i<<"] = "<< it->m_GTPartition0TriggerRates[i]<<std::endl;
130  }
131 
132 for(size_t i=0; i<it->m_GTPartition0DeadTime.size(); i++ ){
133  std::cout << " m_GTPartition0DeadTime["<<i<<"] = "<< it->m_GTPartition0DeadTime[i]<<std::endl;
134  }
135 for(size_t i=0; i<it->m_GTPartition0DeadTimeRatio.size(); i++ ){
136  std::cout << " m_GTPartition0DeadTimeRatio["<<i<<"] = "<< it->m_GTPartition0DeadTimeRatio[i]<<std::endl;
137  }
138  }
139  */
140  }
142 }
143 
144 
RunNumber_t run() const
Definition: EventID.h:39
void printRunValue() const
EventNumber_t event() const
Definition: EventID.h:41
void printGTTechCounts() const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
void beginJob()
Definition: Breakpoints.cc:15
L1TriggerScalerESAnalyzer(edm::ParameterSet const &p)
void printGTPartition0DeadTime() const
void printGTAlgoRates() const
void printGTTechPrescaling() const
void printGTAlgoPrescaling() const
void printLumiSegmentValues() const
void printGTAlgoCounts() const
void printFormat() const
void printGTPartition0TriggerCounts() const
void printGTPartition0DeadTimeRatio() const
void printGTPartition0TriggerRates() const
void printGTTechRates() const
heterocontainer::HCTypeTag TypeTag
edm::EventID id() const
Definition: EventBase.h:60
T get() const
Definition: EventSetup.h:68
T const * product() const
Definition: ESHandle.h:84
virtual example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: Run.h:44