CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1TCSCTFClient.cc
Go to the documentation of this file.
2 
9 #include "TRandom.h"
10 using namespace edm;
11 using namespace std;
12 
14  parameters = ps;
15  initialize();
16 }
17 
19 
20 //--------------------------------------------------------
22  counterLS = 0;
23  counterEvt = 0;
24 
25  input_dir = parameters.getUntrackedParameter<string>("input_dir", "");
26  output_dir = parameters.getUntrackedParameter<string>("output_dir", "");
27  prescaleLS = parameters.getUntrackedParameter<int>("prescaleLS", -1);
28  prescaleEvt = parameters.getUntrackedParameter<int>("prescaleEvt", -1);
29 
30  m_runInEventLoop = parameters.getUntrackedParameter<bool>("runInEventLoop", false);
31  m_runInEndLumi = parameters.getUntrackedParameter<bool>("runInEndLumi", false);
32  m_runInEndRun = parameters.getUntrackedParameter<bool>("runInEndRun", false);
33  m_runInEndJob = parameters.getUntrackedParameter<bool>("runInEndJob", false);
34 }
35 
37  DQMStore::IGetter &igetter,
38  const edm::LuminosityBlock &lumiSeg,
39  const edm::EventSetup &c) {}
40 
41 //--------------------------------------------------------
43  ibooker.setCurrentFolder(output_dir);
44  csctferrors_ = ibooker.book1D("csctferrors_", "CSCTF Errors", 6, 0, 6);
45 
46  processHistograms(igetter);
47 }
48 
49 //--------------------------------------------------------
51  igetter.setCurrentFolder(input_dir);
52 
53  vector<string> meVec = igetter.getMEs();
54  for (vector<string>::const_iterator it = meVec.begin(); it != meVec.end(); it++) {
55  string full_path = input_dir + "/" + (*it);
56  MonitorElement *me = igetter.get(full_path);
57  if (!me) {
58  LogInfo("TriggerDQM") << full_path << " NOT FOUND.";
59  continue;
60  }
61 
62  // But for now we only do a simple workaround
63  if ((*it) != "CSCTF_errors")
64  continue;
65  TH1F *errors = me->getTH1F();
66  csctferrors_->getTH1F()->Reset();
67  if (!errors)
68  continue;
69  for (int bin = 1; bin <= errors->GetXaxis()->GetNbins(); bin++)
70  csctferrors_->Fill(bin - 0.5, errors->GetBinContent(bin));
71  }
72 }
static AlgebraicMatrix initialize()
void processHistograms(DQMStore::IGetter &)
const edm::EventSetup & c
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual TH1F * getTH1F() const
L1TCSCTFClient(const edm::ParameterSet &ps)
Constructor.
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
~L1TCSCTFClient() override
Destructor.
Log< level::Info, false > LogInfo
virtual std::vector< std::string > getMEs() const
Definition: DQMStore.cc:720
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override