CMS 3D CMS Logo

DQMDaqInfo.cc
Go to the documentation of this file.
1 #include "DQMDaqInfo.h"
3 
5  : runInfoToken_{esConsumes<edm::Transition::BeginLuminosityBlock>()} {}
6 
7 DQMDaqInfo::~DQMDaqInfo() = default;
8 
11 
12  if (iSetup.tryToGet<RunInfoRcd>()) {
13  if (auto sumFED = iSetup.getHandle(runInfoToken_)) {
14  //const RunInfo* summaryFED=sumFED.product();
15 
16  std::vector<int> FedsInIds = sumFED->m_fed_in;
17 
18  float FedCount[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.};
19 
20  for (int fedID : FedsInIds) {
21  if (fedID >= PixelRange.first && fedID <= PixelRange.second)
22  ++FedCount[Pixel];
23  if (fedID >= TrackerRange.first && fedID <= TrackerRange.second)
24  ++FedCount[SiStrip];
25  if (fedID >= CSCRange.first && fedID <= CSCRange.second)
26  ++FedCount[CSC];
27  if (fedID >= RPCRange.first && fedID <= RPCRange.second)
28  ++FedCount[RPC];
29  if (fedID >= DTRange.first && fedID <= DTRange.second)
30  ++FedCount[DT];
31  if (fedID >= HcalRange.first && fedID <= HcalRange.second)
32  ++FedCount[Hcal];
33  if (fedID >= ECALBarrRange.first && fedID <= ECALBarrRange.second)
34  ++FedCount[EcalBarrel];
35  if ((fedID >= ECALEndcapRangeLow.first && fedID <= ECALEndcapRangeLow.second) ||
36  (fedID >= ECALEndcapRangeHigh.first && fedID <= ECALEndcapRangeHigh.second))
37  ++FedCount[EcalEndcap];
38  if (fedID >= L1TRange.first && fedID <= L1TRange.second)
39  ++FedCount[L1T];
40  }
41 
42  for (int detIndex = 0; detIndex < 9; ++detIndex) {
43  DaqFraction[detIndex]->Fill(FedCount[detIndex] / NumberOfFeds[detIndex]);
44  }
45  }
46  } else {
47  for (auto& detIndex : DaqFraction)
48  detIndex->Fill(-1);
49  return;
50  }
51 }
52 
54  dbe_ = nullptr;
55  dbe_ = edm::Service<DQMStore>().operator->();
56 
57  std::string commonFolder = "/EventInfo/DAQContents";
58  std::string subsystFolder;
59  std::string curentFolder;
60 
61  subsystFolder = "Pixel";
62  curentFolder = subsystFolder + commonFolder;
63  dbe_->setCurrentFolder(curentFolder);
64  DaqFraction[Pixel] = dbe_->bookFloat("PixelDaqFraction");
65 
66  subsystFolder = "SiStrip";
67  curentFolder = subsystFolder + commonFolder;
68  dbe_->setCurrentFolder(curentFolder);
69  DaqFraction[SiStrip] = dbe_->bookFloat("SiStripDaqFraction");
70 
71  subsystFolder = "RPC";
72  curentFolder = subsystFolder + commonFolder;
73  dbe_->setCurrentFolder(curentFolder);
74  DaqFraction[RPC] = dbe_->bookFloat("RPCDaqFraction");
75 
76  subsystFolder = "CSC";
77  curentFolder = subsystFolder + commonFolder;
78  dbe_->setCurrentFolder(curentFolder);
79  DaqFraction[CSC] = dbe_->bookFloat("CSCDaqFraction");
80 
81  subsystFolder = "DT";
82  curentFolder = subsystFolder + commonFolder;
83  dbe_->setCurrentFolder(curentFolder);
84  DaqFraction[DT] = dbe_->bookFloat("DTDaqFraction");
85 
86  subsystFolder = "Hcal";
87  curentFolder = subsystFolder + commonFolder;
88  dbe_->setCurrentFolder(curentFolder);
89  DaqFraction[Hcal] = dbe_->bookFloat("HcalDaqFraction");
90 
91  subsystFolder = "EcalBarrel";
92  curentFolder = subsystFolder + commonFolder;
93  dbe_->setCurrentFolder(curentFolder);
94  DaqFraction[EcalBarrel] = dbe_->bookFloat("EcalBarrDaqFraction");
95 
96  subsystFolder = "EcalEndcap";
97  curentFolder = subsystFolder + commonFolder;
98  dbe_->setCurrentFolder(curentFolder);
99  DaqFraction[EcalEndcap] = dbe_->bookFloat("EcalEndDaqFraction");
100 
101  subsystFolder = "L1T";
102  curentFolder = subsystFolder + commonFolder;
103  dbe_->setCurrentFolder(curentFolder);
104  DaqFraction[L1T] = dbe_->bookFloat("L1TDaqFraction");
105 
112  RPCRange.first = 790;
113  RPCRange.second = 792;
114  DTRange.first = 770;
115  DTRange.second = 774;
120  ECALBarrRange.first = 610;
121  ECALBarrRange.second = 645;
122  ECALEndcapRangeLow.first = 601;
123  ECALEndcapRangeLow.second = 609;
124  ECALEndcapRangeHigh.first = 646;
125  ECALEndcapRangeHigh.second = 654;
126 
127  NumberOfFeds[Pixel] = PixelRange.second - PixelRange.first + 1;
128  NumberOfFeds[SiStrip] = TrackerRange.second - TrackerRange.first + 1;
129  NumberOfFeds[CSC] = CSCRange.second - CSCRange.first + 1;
130  NumberOfFeds[RPC] = RPCRange.second - RPCRange.first + 1;
131  NumberOfFeds[DT] = DTRange.second - DTRange.first + 1;
132  NumberOfFeds[Hcal] = HcalRange.second - HcalRange.first + 1;
133  NumberOfFeds[EcalBarrel] = ECALBarrRange.second - ECALBarrRange.first + 1;
135  (ECALEndcapRangeHigh.second - ECALEndcapRangeHigh.first + 1);
136  NumberOfFeds[L1T] = L1TRange.second - L1TRange.first + 1;
137 }
138 
139 void DQMDaqInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {}
DQMDaqInfo::SiStrip
Definition: DQMDaqInfo.h:60
DQMDaqInfo::~DQMDaqInfo
~DQMDaqInfo() override
FEDNumbering.h
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
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
DQMDaqInfo::runInfoToken_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: DQMDaqInfo.h:57
DQMDaqInfo::TrackerRange
std::pair< int, int > TrackerRange
Definition: DQMDaqInfo.h:65
FEDNumbering::MAXCSCFEDID
Definition: FEDNumbering.h:52
DQMDaqInfo::dbe_
DQMStore * dbe_
Definition: DQMDaqInfo.h:58
DQMDaqInfo::EcalBarrel
Definition: DQMDaqInfo.h:60
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
DQMDaqInfo::HcalRange
std::pair< int, int > HcalRange
Definition: DQMDaqInfo.h:69
edm::EventSetup::tryToGet
std::optional< T > tryToGet() const
Definition: EventSetup.h:108
DQMDaqInfo::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
Definition: DQMDaqInfo.cc:9
FEDNumbering::MAXSiPixelFEDID
Definition: FEDNumbering.h:28
DQMDaqInfo::ECALEndcapRangeHigh
std::pair< int, int > ECALEndcapRangeHigh
Definition: DQMDaqInfo.h:72
DQMDaqInfo::DaqFraction
MonitorElement * DaqFraction[9]
Definition: DQMDaqInfo.h:62
DQMDaqInfo::RPC
Definition: DQMDaqInfo.h:60
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
FEDNumbering::MAXTriggerGTPFEDID
Definition: FEDNumbering.h:62
DQMDaqInfo::EcalEndcap
Definition: DQMDaqInfo.h:60
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
DQMDaqInfo::DTRange
std::pair< int, int > DTRange
Definition: DQMDaqInfo.h:68
RunInfoRcd
Definition: RunSummaryRcd.h:26
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DQMDaqInfo::NumberOfFeds
float NumberOfFeds[9]
Definition: DQMDaqInfo.h:75
DQMDaqInfo::beginJob
void beginJob() override
Definition: DQMDaqInfo.cc:53
FEDNumbering::MAXSiStripFEDID
Definition: FEDNumbering.h:30
edm::ParameterSet
Definition: ParameterSet.h:47
DQMDaqInfo::Pixel
Definition: DQMDaqInfo.h:60
edm::Service
Definition: Service.h:30
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
DQMDaqInfo::L1T
Definition: DQMDaqInfo.h:60
edm::EventSetup
Definition: EventSetup.h:58
FEDNumbering::MINCSCFEDID
Definition: FEDNumbering.h:51
DQMDaqInfo::Hcal
Definition: DQMDaqInfo.h:60
FEDNumbering::MINSiPixelFEDID
Definition: FEDNumbering.h:27
DQMDaqInfo.h
DQMDaqInfo::RPCRange
std::pair< int, int > RPCRange
Definition: DQMDaqInfo.h:67
DQMDaqInfo::DQMDaqInfo
DQMDaqInfo(const edm::ParameterSet &)
Definition: DQMDaqInfo.cc:4
DQMDaqInfo::ECALBarrRange
std::pair< int, int > ECALBarrRange
Definition: DQMDaqInfo.h:70
DQMDaqInfo::DT
Definition: DQMDaqInfo.h:60
FEDNumbering::MINHCALFEDID
Definition: FEDNumbering.h:47
DQMDaqInfo::ECALEndcapRangeLow
std::pair< int, int > ECALEndcapRangeLow
Definition: DQMDaqInfo.h:71
DQMDaqInfo::CSC
Definition: DQMDaqInfo.h:60
DQMDaqInfo::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: DQMDaqInfo.cc:139
FEDNumbering::MAXHCALFEDID
Definition: FEDNumbering.h:48
DQMDaqInfo::PixelRange
std::pair< int, int > PixelRange
Definition: DQMDaqInfo.h:64
edm::Event
Definition: Event.h:73
DQMDaqInfo::L1TRange
std::pair< int, int > L1TRange
Definition: DQMDaqInfo.h:73
DQMDaqInfo::CSCRange
std::pair< int, int > CSCRange
Definition: DQMDaqInfo.h:66
FEDNumbering::MINTriggerGTPFEDID
Definition: FEDNumbering.h:61
FEDNumbering::MINSiStripFEDID
Definition: FEDNumbering.h:29