28 LogTrace(
"DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest") <<
"[DTDataIntegrityTest]: Constructor";
39 LogTrace(
"DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest")
40 <<
"DataIntegrityTest: analyzed " <<
nupdates <<
" updates";
56 summaryHisto = ibooker.
book2D(
"DataIntegritySummary",
"Summary Data Integrity", 12, 1, 13, 5, -2, 3);
62 summaryTDCHisto = ibooker.
book2D(
"DataIntegrityTDCSummary",
"TDC Summary Data Integrity", 12, 1, 13, 5, -2, 3);
68 glbSummaryHisto = ibooker.
book2D(
"DataIntegrityGlbSummary",
"Summary Data Integrity", 12, 1, 13, 5, -2, 3);
78 string nLumiSegs_s = to_string(
nLumiSegs);
84 LogTrace(
"DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest")
85 <<
"[DTDataIntegrityTest]: End of LS " <<
nLumiSegs <<
", performing client operations";
102 for (
int dduId = FEDIDmin; dduId <= FEDIDmax; ++dduId) {
103 LogTrace(
"DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest") <<
"[DTDataIntegrityTest]:FED Id: " << dduId;
106 string dduId_s = to_string(dduId);
111 string rosStatusName =
"DT/00-DataIntegrity/FED" + dduId_s +
"/FED" + dduId_s +
"_ROSStatus";
113 rosStatusName =
"DT/00-DataIntegrity/FED" + dduId_s +
"/FED" + dduId_s +
"_uROSStatus";
117 string fedSummaryName =
"DT/00-DataIntegrity/FED" + dduId_s +
"_ROSSummary";
121 string fedSummaryName1 =
"";
122 string fedSummaryName2 =
"";
125 if (dduId == FEDIDmin || dduId == FEDIDmax) {
126 if (dduId == FEDIDmax)
128 fedSummaryName2 =
"DT/00-DataIntegrity/ROSSummary_W" + sign +
"2";
129 fedSummaryName1 =
"DT/00-DataIntegrity/ROSSummary_W" + sign +
"1";
130 FED_ROSSummary1 = igetter.
get(fedSummaryName1);
131 FED_ROSSummary2 = igetter.
get(fedSummaryName2);
133 fedSummaryName =
"DT/00-DataIntegrity/ROSSummary_W0";
134 FED_ROSSummary1 = igetter.
get(fedSummaryName);
135 FED_ROSSummary2 = igetter.
get(fedSummaryName);
138 FED_ROSSummary = igetter.
get(fedSummaryName);
141 string fedEvLenName =
"DT/00-DataIntegrity/FED" + dduId_s +
"/FED" + dduId_s +
"_EventLength";
152 int offsetFED = 1368;
154 bool fedNotReadout = (hFEDEntry->
getBinContent(dduId - offsetFED)) == 0;
155 int wheel = dduId - offsetFED - 2;
156 if (FED_ROSSummary1 && FED_ROSSummary2 && FED_ROSStatus && FED_EvLength && !fedNotReadout) {
157 TH2F* histoFEDSummary1 = FED_ROSSummary1->
getTH2F();
158 TH2F* histoFEDSummary2 = FED_ROSSummary2->
getTH2F();
159 TH2F* histoROSStatus = FED_ROSStatus->
getTH2F();
160 TH1F* histoEvLength = FED_EvLength->
getTH1F();
162 int nFEDEvts = histoEvLength->Integral();
166 int extraFEDevents1 = 0;
167 int extraFEDevents2 = 0;
169 for (
int urosNumber = 1; urosNumber <=
DOCESLOTS; ++urosNumber) {
170 string urosNumber_s = to_string(urosNumber);
172 string fedUrosEvLenName =
"DT/00-DataIntegrity/FED" + dduId_s +
"/uROS" + urosNumber_s +
"/FED" + dduId_s +
173 "_uROS" + urosNumber_s +
"_EventLength";
175 TH1F* histoUrosEvLength = FED_uROS_EvLength->
getTH1F();
176 int nFEDEvtsUros = histoUrosEvLength->Integral();
179 if (urosNumber == 1) {
180 extraFEDevents1 = nFEDEvtsUros;
183 if (urosNumber == 2) {
184 extraFEDevents2 = nFEDEvtsUros;
188 if (nFEDEvtsUros > 0) {
189 nFEDEvtsUros = extraFEDevents1 + extraFEDevents2 + nFEDEvtsUros / 3.;
190 float nGErrors = histoROSStatus->Integral(1, 12, urosNumber, urosNumber);
193 int ros =
getROS(urosNumber, 0);
194 for (
int iros = ros; iros < (ros + 3); ++iros) {
196 float nROBErrors1 = histoFEDSummary1->Integral(1, 5, iros, iros);
197 float nErrors1 = nROBErrors1 + nGErrors;
199 if (nFEDEvtsUros != 0)
200 result1 =
max((
float)0., ((
float)nFEDEvtsUros - nROBErrors1) / (
float)nFEDEvtsUros);
202 double tdcResult1 = -2;
203 float nTDCErrors1 = histoFEDSummary1->Integral(6, 6, iros, iros);
204 if (nTDCErrors1 == 0) {
212 float sectPerc1 = 0.;
213 if (nFEDEvtsUros != 0)
214 sectPerc1 =
max((
float)0., ((
float)nFEDEvtsUros - nErrors1) / (
float)nFEDEvtsUros);
216 if (dduId == (FEDIDmax - 1))
220 float nROBErrors2 = histoFEDSummary2->Integral(1, 5, iros, iros);
221 float nErrors2 = nROBErrors2 + nGErrors;
223 if (nFEDEvtsUros != 0)
224 result2 =
max((
float)0., ((
float)nFEDEvtsUros - nROBErrors2) / (
float)nFEDEvtsUros);
227 double tdcResult2 = -2;
228 float nTDCErrors2 = histoFEDSummary2->Integral(6, 6, iros, iros);
229 if (nTDCErrors2 == 0) {
237 float sectPerc2 = 0.;
238 if (nFEDEvtsUros != 0)
239 sectPerc2 =
max((
float)0., ((
float)nFEDEvtsUros - nErrors2) / (
float)nFEDEvtsUros);
249 if (dduId == (FEDIDmax - 1))
259 if (hFEDEntry && hFEDFatal && hFEDNonFatal) {
260 if (FED_ROSSummary && FED_ROSStatus && FED_EvLength) {
261 TH2F* histoFEDSummary = FED_ROSSummary->
getTH2F();
262 TH2F* histoROSStatus = FED_ROSStatus->
getTH2F();
263 TH1F* histoEvLength = FED_EvLength->
getTH1F();
269 int nFEDEvts = histoEvLength->Integral();
270 for (
int rosNumber = 1; rosNumber <= 12; ++rosNumber) {
273 float nErrors = histoFEDSummary->Integral(1, 14, rosNumber, rosNumber);
274 float nROBErrors = histoROSStatus->Integral(2, 8, rosNumber, rosNumber);
275 nErrors += nROBErrors;
278 result =
max((
float)0., ((
float)nFEDEvts - nROBErrors) / (
float)nFEDEvts);
281 float nTDCErrors = histoFEDSummary->Integral(15, 15, rosNumber, rosNumber);
282 if (nTDCErrors == 0) {
289 float sectPerc =
max((
float)0., ((
float)nFEDEvts - nErrors) / (
float)nFEDEvts);
301 for (
int rosNumber = 1; rosNumber <= 12; ++rosNumber) {
319 LogTrace(
"DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest") <<
"[DTDataIntegrityTest] endjob called!";
324 stringstream dduID_s;
327 string folderName =
"DT/00-DataIntegrity/FED" + dduID_s.str();
329 string histoName = folderName +
"/FED" + dduID_s.str() +
"_" + histoType;
334 stringstream dduId_s;
343 return mapping->
readOutToGeometry(dduId, ros, 2, 2, 2, wheel, dummy, sector, dummy, dummy, dummy);
394 int ros = (link / 24) + 3 * (slot % 6) - 2;
LuminosityBlockID id() const
T getUntrackedParameter(std::string const &, T const &) const
virtual TH2F * getTH2F() const
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
void setCurrentFolder(std::string const &fullpath)
virtual TH1F * getTH1F() const
MonitorElement * summaryTDCHisto
DTDataIntegrityTest(const edm::ParameterSet &ps)
Constructor.
MonitorElement * glbSummaryHisto
static const int DOCESLOTS
std::string getMEName(std::string histoType, int FEDId)
Get the ME name.
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
DQM Client Diagnostic.
virtual double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * summaryHisto
int readOutToGeometry(int dduId, int rosNumber, int &wheel, int §or)
edm::ESHandle< DTReadOutMapping > mapping
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
LuminosityBlockNumber_t luminosityBlock() const
int getROS(int uROS, int link)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
~DTDataIntegrityTest() override
Destructor.
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
void bookHistos(DQMStore::IBooker &, std::string histoType, int dduId)
Book the MEs.
MonitorElement * get(std::string const &path)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)