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 
21 
23 
25 
26 using namespace std;
27 using namespace edm;
28 
30  : mappingToken_(esConsumes<edm::Transition::EndLuminosityBlock>()),
31  runInfoToken_(esConsumes<edm::Transition::EndLuminosityBlock>()) {
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
44  mapping = &setup.getData(mappingToken_);
45 
46  // book the ME
47  // global fraction
48 
49  ibooker.setCurrentFolder("DT/EventInfo");
50 
51  totalDAQFraction = ibooker.bookFloat("DAQSummary");
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
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  auto sumFED = runInfoRec->get(runInfoToken_);
84  const vector<int> fedInIDs = sumFED.m_fed_in;
85 
86  // the range of DT feds
87  static const int FEDIDmin = FEDNumbering::MINDTFEDID;
88  static const int FEDIDMax = FEDNumbering::MAXDTFEDID;
89 
90  //FIXME for uROS FEDIDs once mapping has been defined
91  if (checkUros) {
92  LogTrace("DQM|DTMonitorClient|DTDAQInfo") << "Checking uROS FEDs as Legacy FEDs" << endl;
93  }
94 
95  // loop on all active feds
96  for (vector<int>::const_iterator fed = fedInIDs.begin(); fed != fedInIDs.end(); ++fed) {
97  // check if the fed is in the DT range
98  if (!(*fed >= FEDIDmin && *fed <= FEDIDMax))
99  continue;
100 
101  // check if the 12 channels are connected to any sector and fill the wheel percentage accordignly
102  int wheel = -99;
103  int sector = -99;
104  int dummy = -99;
105  for (int ros = 1; ros != 13; ++ros) {
106  if (!mapping->readOutToGeometry(*fed, ros, 2, 2, 2, wheel, dummy, sector, dummy, dummy, dummy)) {
107  LogTrace("DQM|DTMonitorClient|DTDAQInfo")
108  << "FED: " << *fed << " Ch: " << ros << " wheel: " << wheel << " Sect: " << sector << endl;
109  daqFractions[wheel]->Fill(daqFractions[wheel]->getFloatValue() + 1. / 12.);
111  daqMap->Fill(sector, wheel);
112  }
113  }
114  }
115  } else {
116  LogWarning("DQM|DTMonitorClient|DTDAQInfo") << "*** Warning: record key not found for RunInfoRcd" << endl;
117  totalDAQFraction->Fill(-1);
118  for (int wheel = -2; wheel != 3; ++wheel) {
119  daqFractions[wheel]->Fill(-1);
120  }
121  return;
122  }
123 }
124 
FEDNumbering.h
DTDAQInfo::daqFractions
std::map< int, MonitorElement * > daqFractions
Definition: DTDAQInfo.h:53
MessageLogger.h
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
DTDAQInfo::mappingToken_
edm::ESGetToken< DTReadOutMapping, DTReadOutMappingRcd > mappingToken_
Definition: DTDAQInfo.h:54
ESHandle.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
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::daqMap
MonitorElement * daqMap
Definition: DTDAQInfo.h:52
FEDNumbering::MAXDTFEDID
Definition: FEDNumbering.h:56
DTDAQInfo::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: DTDAQInfo.cc:125
DTDAQInfo::runInfoToken_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: DTDAQInfo.h:57
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
DTDAQInfo::checkUros
bool checkUros
Definition: DTDAQInfo.h:49
DTDAQInfo::totalDAQFraction
MonitorElement * totalDAQFraction
Definition: DTDAQInfo.h:51
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
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:345
DTDAQInfo::mapping
const DTReadOutMapping * mapping
Definition: DTDAQInfo.h:55
DTDAQInfo::~DTDAQInfo
~DTDAQInfo() override
Destructor.
Definition: DTDAQInfo.cc:36
HLT_Fake1_cff.streams
streams
Definition: HLT_Fake1_cff.py:13
RunInfoRcd
Definition: RunSummaryRcd.h:26
dqm::impl::MonitorElement::getFloatValue
virtual double getFloatValue() const
Definition: MonitorElement.cc:920
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTReadOutMapping::readOutToGeometry
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
Definition: DTReadOutMapping.cc:69
DTDAQInfo::sumFED
const RunInfo * sumFED
Definition: DTDAQInfo.h:58
edm::EventSetup
Definition: EventSetup.h:58
RunSummary.h
RunInfo.h
edm::Transition::EndLuminosityBlock
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
EventSetup.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
DTDAQInfo::bookingdone
bool bookingdone
Definition: DTDAQInfo.h:46
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
dummy
Definition: DummySelector.h:38
FEDNumbering::MINDTFEDID
Definition: FEDNumbering.h:55
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
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:791
DTDAQInfo::DTDAQInfo
DTDAQInfo(const edm::ParameterSet &pset)
Constructor.
Definition: DTDAQInfo.cc:29
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