CMS 3D CMS Logo

DQMScalInfo.cc
Go to the documentation of this file.
1 /*
2  * \file DQMDcsInfo.cc
3  * \author A.Meyer - DESY
4  * Last Update:
5  *
6  */
7 
8 #include "DQMScalInfo.h"
13 
19 
20 using namespace std;
21 using namespace edm;
22 
23 // Framework
24 
26  parameters_ = ps;
27 
28  scalfolder_ = parameters_.getUntrackedParameter<std::string>("dqmScalFolder", "Scal");
29  gtCollection_ = consumes<L1GlobalTriggerReadoutRecord>(
30  parameters_.getUntrackedParameter<edm::InputTag>("gtCollection", edm::InputTag("gtDigis")));
31  dcsStatusCollection_ = consumes<DcsStatusCollection>(
32  parameters_.getUntrackedParameter<edm::InputTag>("dcsStatusCollection", edm::InputTag("scalersRawToDigi")));
33  l1tscollectionToken_ = consumes<Level1TriggerScalersCollection>(
34  parameters_.getUntrackedParameter<edm::InputTag>("l1TSCollection", edm::InputTag("scalersRawToDigi")));
35  lumicollectionToken_ = consumes<LumiScalersCollection>(
36  parameters_.getUntrackedParameter<edm::InputTag>("lumiCollection", edm::InputTag("scalersRawToDigi")));
37 }
38 
39 DQMScalInfo::~DQMScalInfo() = default;
40 
42  edm::Run const& /* iRun */,
43  edm::EventSetup const& /* iSetup */) {
44  const int maxNbins = 2001;
45 
46  // Fetch GlobalTag information and fill the string/ME.
47  ibooker.cd();
48  ibooker.setCurrentFolder(scalfolder_ + "/L1TriggerScalers/");
49  const int fracLS = 16;
50  const int maxLS = 250;
51  hlresync_ = ibooker.book1D("lresync", "Orbit of last resync", fracLS * maxLS, 0, maxLS * 262144);
52  hlOC0_ = ibooker.book1D("lOC0", "Orbit of last OC0", fracLS * maxLS, 0, maxLS * 262144);
53  hlTE_ = ibooker.book1D("lTE", "Orbit of last TestEnable", fracLS * maxLS, 0, maxLS * 262144);
54  hlstart_ = ibooker.book1D("lstart", "Orbit of last Start", fracLS * maxLS, 0, maxLS * 262144);
55  hlEC0_ = ibooker.book1D("lEC0", "Orbit of last EC0", fracLS * maxLS, 0, maxLS * 262144);
56  hlHR_ = ibooker.book1D("lHR", "Orbit of last HardReset", fracLS * maxLS, 0, maxLS * 262144);
57 
58  hphysTrig_ = ibooker.book1D("Physics_Triggers", "Physics Triggers", maxNbins, -0.5, double(maxNbins) - 0.5);
59  hphysTrig_->setAxisTitle("Lumi Section", 1);
60 
61  ibooker.cd();
62  ibooker.setCurrentFolder(scalfolder_ + "/LumiScalers/");
63  hinstLumi_ = ibooker.book1D("Instant_Lumi", "Instant Lumi", maxNbins, -0.5, double(maxNbins) - 0.5);
64 }
65 
67  makeL1Scalars(e);
68  makeLumiScalars(e);
69  return;
70 }
71 
74  e.getByToken(l1tscollectionToken_, l1ts);
76  e.getByToken(lumicollectionToken_, lumiScalers);
77 
78  auto it = l1ts->begin();
79 
80  if (l1ts->empty())
81  return;
82  hlresync_->Fill((*l1ts)[0].lastResync());
83  hlOC0_->Fill((*l1ts)[0].lastOrbitCounter0());
84  hlTE_->Fill((*l1ts)[0].lastTestEnable());
85  hlstart_->Fill((*l1ts)[0].lastStart());
86  hlEC0_->Fill((*l1ts)[0].lastEventCounter0());
87  hlHR_->Fill((*l1ts)[0].lastHardReset());
88 
89  unsigned int lumisection = it->lumiSegmentNr();
90  if (lumisection) {
91  hphysTrig_->setBinContent(lumisection + 1, it->l1AsPhysics());
92  }
93 
94  return;
95 }
96 
99  e.getByToken(lumicollectionToken_, lumiScalers);
100 
101  auto it = lumiScalers->begin();
102 
103  if (!lumiScalers->empty()) {
104  unsigned int lumisection = it->sectionNumber();
105  if (lumisection) {
106  hinstLumi_->setBinContent(lumisection + 1, it->instantLumi());
107  }
108  }
109 
110  return;
111 }
LumiScalers.h
Handle.h
DQMScalInfo::makeLumiScalars
void makeLumiScalars(const edm::Event &e)
Definition: DQMScalInfo.cc:97
DcsStatus.h
edm::Run
Definition: Run.h:45
DQMScalInfo::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: DQMScalInfo.cc:41
edm
HLT enums.
Definition: AlignableModifier.h:19
V0Monitor_cfi.lumiScalers
lumiScalers
Definition: V0Monitor_cfi.py:9
DQMScalInfo::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
Definition: DQMScalInfo.cc:66
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ScalersRaw.h
edm::Handle
Definition: AssociativeIterator.h:50
Level1TriggerScalers.h
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
L1GtFdlWord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
DQMScalInfo::~DQMScalInfo
~DQMScalInfo() override
Destructor.
DQMScalInfo.h
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
std
Definition: JetResolutionObject.h:76
TimeSpec.h
DQMScalInfo::makeL1Scalars
void makeL1Scalars(const edm::Event &e)
Definition: DQMScalInfo.cc:72
Level1TriggerRates.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
DQMScalInfo::DQMScalInfo
DQMScalInfo(const edm::ParameterSet &ps)
Constructor.
Definition: DQMScalInfo.cc:25
edm::Event
Definition: Event.h:73
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
edm::InputTag
Definition: InputTag.h:15
L1GlobalTriggerReadoutRecord.h
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37