CMS 3D CMS Logo

DQMDaqInfo.cc
Go to the documentation of this file.
1 #include "DQMDaqInfo.h"
3 
5 
6 DQMDaqInfo::~DQMDaqInfo() = default;
7 
10 
11  if (auto runInfoRec = iSetup.tryToGet<RunInfoRcd>()) {
13  runInfoRec->get(sumFED);
14 
15  //const RunInfo* summaryFED=sumFED.product();
16 
17  std::vector<int> FedsInIds = sumFED->m_fed_in;
18 
19  float FedCount[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.};
20 
21  for (int fedID : FedsInIds) {
22  if (fedID >= PixelRange.first && fedID <= PixelRange.second)
23  ++FedCount[Pixel];
24  if (fedID >= TrackerRange.first && fedID <= TrackerRange.second)
25  ++FedCount[SiStrip];
26  if (fedID >= CSCRange.first && fedID <= CSCRange.second)
27  ++FedCount[CSC];
28  if (fedID >= RPCRange.first && fedID <= RPCRange.second)
29  ++FedCount[RPC];
30  if (fedID >= DTRange.first && fedID <= DTRange.second)
31  ++FedCount[DT];
32  if (fedID >= HcalRange.first && fedID <= HcalRange.second)
33  ++FedCount[Hcal];
34  if (fedID >= ECALBarrRange.first && fedID <= ECALBarrRange.second)
35  ++FedCount[EcalBarrel];
36  if ((fedID >= ECALEndcapRangeLow.first && fedID <= ECALEndcapRangeLow.second) ||
37  (fedID >= ECALEndcapRangeHigh.first && fedID <= ECALEndcapRangeHigh.second))
38  ++FedCount[EcalEndcap];
39  if (fedID >= L1TRange.first && fedID <= L1TRange.second)
40  ++FedCount[L1T];
41  }
42 
43  for (int detIndex = 0; detIndex < 9; ++detIndex) {
44  DaqFraction[detIndex]->Fill(FedCount[detIndex] / NumberOfFeds[detIndex]);
45  }
46 
47  } else {
48  for (auto& detIndex : DaqFraction)
49  detIndex->Fill(-1);
50  return;
51  }
52 }
53 
55  dbe_ = nullptr;
57 
58  std::string commonFolder = "/EventInfo/DAQContents";
59  std::string subsystFolder;
60  std::string curentFolder;
61 
62  subsystFolder = "Pixel";
63  curentFolder = subsystFolder + commonFolder;
64  dbe_->setCurrentFolder(curentFolder);
65  DaqFraction[Pixel] = dbe_->bookFloat("PixelDaqFraction");
66 
67  subsystFolder = "SiStrip";
68  curentFolder = subsystFolder + commonFolder;
69  dbe_->setCurrentFolder(curentFolder);
70  DaqFraction[SiStrip] = dbe_->bookFloat("SiStripDaqFraction");
71 
72  subsystFolder = "RPC";
73  curentFolder = subsystFolder + commonFolder;
74  dbe_->setCurrentFolder(curentFolder);
75  DaqFraction[RPC] = dbe_->bookFloat("RPCDaqFraction");
76 
77  subsystFolder = "CSC";
78  curentFolder = subsystFolder + commonFolder;
79  dbe_->setCurrentFolder(curentFolder);
80  DaqFraction[CSC] = dbe_->bookFloat("CSCDaqFraction");
81 
82  subsystFolder = "DT";
83  curentFolder = subsystFolder + commonFolder;
84  dbe_->setCurrentFolder(curentFolder);
85  DaqFraction[DT] = dbe_->bookFloat("DTDaqFraction");
86 
87  subsystFolder = "Hcal";
88  curentFolder = subsystFolder + commonFolder;
89  dbe_->setCurrentFolder(curentFolder);
90  DaqFraction[Hcal] = dbe_->bookFloat("HcalDaqFraction");
91 
92  subsystFolder = "EcalBarrel";
93  curentFolder = subsystFolder + commonFolder;
94  dbe_->setCurrentFolder(curentFolder);
95  DaqFraction[EcalBarrel] = dbe_->bookFloat("EcalBarrDaqFraction");
96 
97  subsystFolder = "EcalEndcap";
98  curentFolder = subsystFolder + commonFolder;
99  dbe_->setCurrentFolder(curentFolder);
100  DaqFraction[EcalEndcap] = dbe_->bookFloat("EcalEndDaqFraction");
101 
102  subsystFolder = "L1T";
103  curentFolder = subsystFolder + commonFolder;
104  dbe_->setCurrentFolder(curentFolder);
105  DaqFraction[L1T] = dbe_->bookFloat("L1TDaqFraction");
106 
113  RPCRange.first = 790;
114  RPCRange.second = 792;
115  DTRange.first = 770;
116  DTRange.second = 774;
121  ECALBarrRange.first = 610;
122  ECALBarrRange.second = 645;
123  ECALEndcapRangeLow.first = 601;
124  ECALEndcapRangeLow.second = 609;
125  ECALEndcapRangeHigh.first = 646;
126  ECALEndcapRangeHigh.second = 654;
127 
128  NumberOfFeds[Pixel] = PixelRange.second - PixelRange.first + 1;
129  NumberOfFeds[SiStrip] = TrackerRange.second - TrackerRange.first + 1;
130  NumberOfFeds[CSC] = CSCRange.second - CSCRange.first + 1;
131  NumberOfFeds[RPC] = RPCRange.second - RPCRange.first + 1;
132  NumberOfFeds[DT] = DTRange.second - DTRange.first + 1;
133  NumberOfFeds[Hcal] = HcalRange.second - HcalRange.first + 1;
134  NumberOfFeds[EcalBarrel] = ECALBarrRange.second - ECALBarrRange.first + 1;
136  (ECALEndcapRangeHigh.second - ECALEndcapRangeHigh.first + 1);
137  NumberOfFeds[L1T] = L1TRange.second - L1TRange.first + 1;
138 }
139 
141 
142 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:94
void beginJob() override
Definition: DQMDaqInfo.cc:54
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
float NumberOfFeds[9]
Definition: DQMDaqInfo.h:75
MonitorElement * DaqFraction[9]
Definition: DQMDaqInfo.h:62
std::pair< int, int > RPCRange
Definition: DQMDaqInfo.h:67
void endJob() override
Definition: DQMDaqInfo.cc:140
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::vector< int > m_fed_in
Definition: RunInfo.h:25
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Definition: DQMDaqInfo.cc:8
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:142
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:639
MonitorElement * bookFloat(char_string const &name)
Book float.
Definition: DQMStore.cc:1087
~DQMDaqInfo() override
std::pair< int, int > HcalRange
Definition: DQMDaqInfo.h:69