CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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;
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) {}
std::pair< int, int > DTRange
Definition: DQMDaqInfo.h:68
std::optional< T > tryToGet() const
Definition: EventSetup.h:103
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
void beginJob() override
Definition: DQMDaqInfo.cc:53
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
float NumberOfFeds[9]
Definition: DQMDaqInfo.h:75
MonitorElement * DaqFraction[9]
Definition: DQMDaqInfo.h:62
std::pair< int, int > RPCRange
Definition: DQMDaqInfo.h:67
void Fill(long long x)
DQMDaqInfo(const edm::ParameterSet &)
Definition: DQMDaqInfo.cc:4
DQMStore * dbe_
Definition: DQMDaqInfo.h:58
int iEvent
Definition: GenABIO.cc:224
std::pair< int, int > TrackerRange
Definition: DQMDaqInfo.h:65
std::pair< int, int > CSCRange
Definition: DQMDaqInfo.h:66
std::pair< int, int > ECALEndcapRangeHigh
Definition: DQMDaqInfo.h:72
std::pair< int, int > PixelRange
Definition: DQMDaqInfo.h:64
std::pair< int, int > ECALBarrRange
Definition: DQMDaqInfo.h:70
std::pair< int, int > L1TRange
Definition: DQMDaqInfo.h:73
std::pair< int, int > ECALEndcapRangeLow
Definition: DQMDaqInfo.h:71
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: DQMDaqInfo.cc:139
~DQMDaqInfo() override
std::pair< int, int > HcalRange
Definition: DQMDaqInfo.h:69
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
Definition: DQMDaqInfo.cc:9
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: DQMDaqInfo.h:57
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