CMS 3D CMS Logo

DTDAQInfo.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author G. Cerminara - INFN Torino
5  *
6  * threadsafe version (//-) oct/nov 2014 - WATWanAbdullah ncpp-um-my
7  *
8  */
9 
12 
16 
18 
22 
25 
27 
28 using namespace std;
29 using namespace edm;
30 
32  bookingdone = false;
33  checkUros = pset.getUntrackedParameter<bool>("checkUros", true);
34 }
35 
37 
39  DQMStore::IGetter& igetter,
40  edm::LuminosityBlock const& lumiSeg,
41  edm::EventSetup const& setup) {
42  if (!bookingdone) {
43  // retrieve the mapping
45 
46  // book the ME
47  // global fraction
48 
49  ibooker.setCurrentFolder("DT/EventInfo");
50 
51  totalDAQFraction = ibooker.bookFloat("DAQSummary");
52  totalDAQFraction->Fill(-1);
53 
54  // map
55  daqMap = ibooker.book2D("DAQSummaryMap", "DT Certification Summary Map", 12, 1, 13, 5, -2, 3);
56  daqMap->setAxisTitle("sector", 1);
57  daqMap->setAxisTitle("wheel", 2);
58 
59  // Wheel "fractions" -> will be 0 or 1
60 
61  ibooker.setCurrentFolder("DT/EventInfo/DAQContents");
62  for (int wheel = -2; wheel != 3; ++wheel) {
63  stringstream streams;
64  streams << "DT_Wheel" << wheel;
65 
66  daqFractions[wheel] = ibooker.bookFloat(streams.str());
67  daqFractions[wheel]->Fill(-1);
68  }
69  bookingdone = true;
70  } //booking done
71 
72  if (auto runInfoRec = setup.tryToGet<RunInfoRcd>()) {
73  // reset to 0
74  totalDAQFraction->Fill(0.);
75  daqFractions[-2]->Fill(0.);
76  daqFractions[-1]->Fill(0.);
77  daqFractions[-0]->Fill(0.);
78  daqFractions[1]->Fill(0.);
79  daqFractions[2]->Fill(0.);
80 
81  daqMap->Reset();
82  //get fed summary information
83  ESHandle<RunInfo> sumFED;
84  runInfoRec->get(sumFED);
85  vector<int> fedInIDs = sumFED->m_fed_in;
86 
87  // the range of DT feds
88  static const int FEDIDmin = FEDNumbering::MINDTFEDID;
89  static const int FEDIDMax = FEDNumbering::MAXDTFEDID;
90 
91  //FIXME for uROS FEDIDs once mapping has been defined
92  if (checkUros) {
93  LogTrace("DQM|DTMonitorClient|DTDAQInfo") << "Checking uROS FEDs as Legacy FEDs" << endl;
94  }
95 
96  // loop on all active feds
97  for (vector<int>::const_iterator fed = fedInIDs.begin(); fed != fedInIDs.end(); ++fed) {
98  // check if the fed is in the DT range
99  if (!(*fed >= FEDIDmin && *fed <= FEDIDMax))
100  continue;
101 
102  // check if the 12 channels are connected to any sector and fill the wheel percentage accordignly
103  int wheel = -99;
104  int sector = -99;
105  int dummy = -99;
106  for (int ros = 1; ros != 13; ++ros) {
107  if (!mapping->readOutToGeometry(*fed, ros, 2, 2, 2, wheel, dummy, sector, dummy, dummy, dummy)) {
108  LogTrace("DQM|DTMonitorClient|DTDAQInfo")
109  << "FED: " << *fed << " Ch: " << ros << " wheel: " << wheel << " Sect: " << sector << endl;
110  daqFractions[wheel]->Fill(daqFractions[wheel]->getFloatValue() + 1. / 12.);
111  totalDAQFraction->Fill(totalDAQFraction->getFloatValue() + 1. / 60.);
112  daqMap->Fill(sector, wheel);
113  }
114  }
115  }
116  } else {
117  LogWarning("DQM|DTMonitorClient|DTDAQInfo") << "*** Warning: record key not found for RunInfoRcd" << endl;
118  totalDAQFraction->Fill(-1);
119  for (int wheel = -2; wheel != 3; ++wheel) {
120  daqFractions[wheel]->Fill(-1);
121  }
122  return;
123  }
124 }
125 
FEDNumbering.h
MessageLogger.h
RunSummaryRcd.h
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
ESHandle.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
DTReadOutMappingRcd
Definition: DTReadOutMappingRcd.h:5
edm
HLT enums.
Definition: AlignableModifier.h:19
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
RunInfo::m_fed_in
std::vector< int > m_fed_in
Definition: RunInfo.h:25
DTDAQInfo::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: DTDAQInfo.cc:126
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
DTDAQInfo.h
Service.h
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
edm::ESHandle
Definition: DTSurvey.h:22
DTDAQInfo::~DTDAQInfo
~DTDAQInfo() override
Destructor.
Definition: DTDAQInfo.cc:36
RunInfoRcd
Definition: RunSummaryRcd.h:26
FEDNumbering::MAXDTFEDID
Definition: FEDNumbering.h:56
edm::LogWarning
Definition: MessageLogger.h:141
DTReadOutMappingRcd.h
edm::ParameterSet
Definition: ParameterSet.h:36
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
edm::EventSetup
Definition: EventSetup.h:57
FEDNumbering::MINDTFEDID
Definition: FEDNumbering.h:55
get
#define get
RunSummary.h
RunInfo.h
std
Definition: JetResolutionObject.h:76
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
HLT_2018_cff.streams
streams
Definition: HLT_2018_cff.py:3574
EventSetup.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
dummy
Definition: DummySelector.h:38
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28
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
DTDAQInfo::DTDAQInfo
DTDAQInfo(const edm::ParameterSet &pset)
Constructor.
Definition: DTDAQInfo.cc:31
DTDAQInfo::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: DTDAQInfo.cc:38
DTReadOutMapping.h
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dtBlockedROChannelsTest_cfi.checkUros
checkUros
Definition: dtBlockedROChannelsTest_cfi.py:7