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 
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::eventsetup::heterocontainer::HCTypeTag::findType
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
bk::beginJob
void beginJob()
Definition: Breakpoints.cc:14
mps_fire.i
i
Definition: mps_fire.py:428
L1TriggerScaler::printGTAlgoPrescaling
void printGTAlgoPrescaling() const
Definition: L1TriggerScaler.cc:75
L1TriggerScaler::printGTPartition0TriggerRates
void printGTPartition0TriggerRates() const
Definition: L1TriggerScaler.cc:119
ESHandle.h
L1TriggerScaler::printGTTechCounts
void printGTTechCounts() const
Definition: L1TriggerScaler.cc:83
edm::Run
Definition: Run.h:45
edmtest
Definition: AlignPCLThresholdsReader.cc:11
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1TriggerScaler::printGTTechPrescaling
void printGTTechPrescaling() const
Definition: L1TriggerScaler.cc:101
L1TriggerScaler::printFormat
void printFormat() const
Definition: L1TriggerScaler.cc:50
L1TriggerScaler::printLumiSegmentValues
void printLumiSegmentValues() const
Definition: L1TriggerScaler.cc:43
EDAnalyzer.h
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
visDQMUpload.context
context
Definition: visDQMUpload.py:37
MakerMacros.h
L1TriggerScalerRcd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
L1TriggerScaler::printGTAlgoCounts
void printGTAlgoCounts() const
Definition: L1TriggerScaler.cc:57
L1TriggerScaler::printRunValue
void printRunValue() const
Definition: L1TriggerScaler.cc:38
edmtest::L1TriggerScalerESAnalyzer
Definition: L1TriggerScalerESAnalyzer.cc:24
L1TriggerScaler::printGTPartition0DeadTime
void printGTPartition0DeadTime() const
Definition: L1TriggerScaler.cc:128
L1TriggerScaler
Definition: L1TriggerScaler.h:18
edm::ESHandle
Definition: DTSurvey.h:22
edm::eventsetup::EventSetupRecordKey::TypeTag
heterocontainer::HCTypeTag TypeTag
Definition: EventSetupRecordKey.h:32
L1TriggerScaler::printGTPartition0TriggerCounts
void printGTPartition0TriggerCounts() const
Definition: L1TriggerScaler.cc:110
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Event.h
edm::eventsetup::EventSetupRecordKey::type
const TypeTag & type() const
Definition: EventSetupRecordKey.h:40
edmtest::L1TriggerScalerESAnalyzer::L1TriggerScalerESAnalyzer
L1TriggerScalerESAnalyzer(edm::ParameterSet const &p)
Definition: L1TriggerScalerESAnalyzer.cc:27
analyze
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EventSetup
Definition: EventSetup.h:58
L1TriggerScaler::printGTAlgoRates
void printGTAlgoRates() const
Definition: L1TriggerScaler.cc:66
get
#define get
std
Definition: JetResolutionObject.h:76
L1TriggerScaler.h
edmtest::L1TriggerScalerESAnalyzer::L1TriggerScalerESAnalyzer
L1TriggerScalerESAnalyzer(int i)
Definition: L1TriggerScalerESAnalyzer.cc:31
EventSetup.h
L1TriggerScaler::printGTPartition0DeadTimeRatio
void printGTPartition0DeadTimeRatio() const
Definition: L1TriggerScaler.cc:137
L1TriggerScaler::printGTTechRates
void printGTTechRates() const
Definition: L1TriggerScaler.cc:92
edmtest::L1TriggerScalerESAnalyzer::~L1TriggerScalerESAnalyzer
virtual ~L1TriggerScalerESAnalyzer()
Definition: L1TriggerScalerESAnalyzer.cc:33
L1TriggerScalerRcd
Definition: L1TriggerScalerRcd.h:24
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::Event
Definition: Event.h:73
edm::eventsetup
Definition: ES_DDDetector.cc:16
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37