25 desc.add<Int_t>(
"AMCSlots", 13);
29 descriptions.
add(
"GEMDAQStatusSource",
desc);
36 auto gemChMap = std::make_unique<GEMChMap>(chMap);
38 std::vector<unsigned int> listFEDId;
39 for (
auto const &[ec, dc] : gemChMap->chamberMap()) {
40 unsigned int fedId = ec.fedId;
41 uint8_t amcNum = ec.amcNum;
45 listFEDId.push_back(
fedId);
54 for (
auto fedId : listFEDId) {
60 auto gemChMap = std::make_unique<GEMChMap>();
63 for (
auto const &[ec, dc] : gemChMap->chamberMap()) {
64 unsigned int fedId = ec.fedId;
65 uint8_t amcNum = ec.amcNum;
76 if (h2Status ==
nullptr) {
80 unsigned int unBinPos = 1;
82 h2Status->
setBinLabel(unBinPos++,
"Invalid AMC", 2);
83 h2Status->
setBinLabel(unBinPos++,
"Invalid size", 2);
84 h2Status->
setBinLabel(unBinPos++,
"Fail trailer check", 2);
85 h2Status->
setBinLabel(unBinPos++,
"Fail fragment length", 2);
86 h2Status->
setBinLabel(unBinPos++,
"Fail trailer match", 2);
87 h2Status->
setBinLabel(unBinPos++,
"More trailer", 2);
88 h2Status->
setBinLabel(unBinPos++,
"CRC modified", 2);
89 h2Status->
setBinLabel(unBinPos++,
"S-link error", 2);
90 h2Status->
setBinLabel(unBinPos++,
"Wrong FED ID", 2);
95 h2Status->
setBinLabel(nPos, Form(
"GE%i1-%c", st, re), 1);
100 if (h2Status ==
nullptr) {
104 unsigned int unBinPos = 1;
106 h2Status->
setBinLabel(unBinPos++,
"Invalid OH", 2);
107 h2Status->
setBinLabel(unBinPos++,
"Back pressure", 2);
111 h2Status->
setBinLabel(unBinPos++,
"Bad run type", 2);
113 h2Status->
setBinLabel(unBinPos++,
"MMCM locked", 2);
114 h2Status->
setBinLabel(unBinPos++,
"DAQ clock locked", 2);
115 h2Status->
setBinLabel(unBinPos++,
"DAQ not ready", 2);
116 h2Status->
setBinLabel(unBinPos++,
"BC0 not locked", 2);
120 if (h2Status ==
nullptr) {
124 unsigned int unBinPos = 1;
126 h2Status->
setBinLabel(unBinPos++,
"Event FIFO near full", 2);
127 h2Status->
setBinLabel(unBinPos++,
"Input FIFO near full", 2);
128 h2Status->
setBinLabel(unBinPos++,
"L1A FIFO near full", 2);
129 h2Status->
setBinLabel(unBinPos++,
"Event size warn", 2);
130 h2Status->
setBinLabel(unBinPos++,
"Invalid VFAT", 2);
131 h2Status->
setBinLabel(unBinPos++,
"Event FIFO full", 2);
132 h2Status->
setBinLabel(unBinPos++,
"Input FIFO full", 2);
133 h2Status->
setBinLabel(unBinPos++,
"L1A FIFO full", 2);
134 h2Status->
setBinLabel(unBinPos++,
"Event size overflow", 2);
135 h2Status->
setBinLabel(unBinPos++,
"Invalid event", 2);
136 h2Status->
setBinLabel(unBinPos++,
"Out of Sync AMC vs VFAT", 2);
137 h2Status->
setBinLabel(unBinPos++,
"Out of Sync VFAT vs VFAT", 2);
138 h2Status->
setBinLabel(unBinPos++,
"BX mismatch AMC vs VFAT", 2);
139 h2Status->
setBinLabel(unBinPos++,
"BX mismatch VFAT vs VFAT", 2);
140 h2Status->
setBinLabel(unBinPos++,
"Input FIFO underflow", 2);
141 h2Status->
setBinLabel(unBinPos++,
"Bad VFAT count", 2);
145 if (h2Status ==
nullptr) {
149 unsigned int unBinPos = 1;
151 h2Status->
setBinLabel(unBinPos++,
"Basic overflow", 2);
152 h2Status->
setBinLabel(unBinPos++,
"Zero-sup overflow", 2);
153 h2Status->
setBinLabel(unBinPos++,
"VFAT CRC error", 2);
154 h2Status->
setBinLabel(unBinPos++,
"Invalid header", 2);
155 h2Status->
setBinLabel(unBinPos++,
"AMC EC mismatch", 2);
156 h2Status->
setBinLabel(unBinPos++,
"AMC BC mismatch", 2);
184 "amc13_status",
"AMC13 Status;AMC13;", nNumAMC13, 0.5, nNumAMC13 + 0.5,
nBitAMC13_, 0.5,
nBitAMC13_ + 0.5);
190 auto strName = Form(
"amc_status_GE%i1-%c", st, re);
191 auto strTitle = Form(
"AMC Status GE%i1-%c;AMC slot;", st, re);
204 this,
"vfat_statusWarnSum",
"VFAT reporting warnings", 36, 0.5, 36.5, 24, -0.5, 24 - 0.5,
"Chamber",
"VFAT");
206 this,
"vfat_statusErrSum",
"VFAT reporting errors", 36, 0.5, 36.5, 24, -0.5, 24 - 0.5,
"Chamber",
"VFAT");
301 event.getByToken(
tagVFAT_, gemVFAT);
302 event.getByToken(
tagOH_, gemOH);
303 event.getByToken(
tagAMC_, gemAMC);
314 std::map<ME4IdsKey, bool> mapChamberAll;
315 std::map<ME4IdsKey, bool> mapChamberWarning;
316 std::map<ME4IdsKey, bool> mapChamberError;
317 std::map<ME4IdsKey, bool> mapChamberVFATWarning;
318 std::map<ME4IdsKey, bool> mapChamberVFATError;
319 std::map<ME4IdsKey, bool> mapChamberOHWarning;
320 std::map<ME4IdsKey, bool> mapChamberOHError;
321 std::map<ME4IdsKey, bool> mapChamberAMCWarning;
322 std::map<ME4IdsKey, bool> mapChamberAMCError;
323 std::map<ME4IdsKey, bool> mapChamberAMC13Error;
325 for (
auto amc13It = gemAMC13->
begin(); amc13It != gemAMC13->
end(); ++amc13It) {
326 int fedId = (*amc13It).first;
332 const auto &
range = (*amc13It).second;
334 Bool_t bWarn =
false;
349 if (
errors.failTrailerCheck)
351 if (
errors.failFragmentLength)
353 if (
errors.failTrailerMatch)
366 if (!bWarn && !bErr) {
372 for (
auto gid : listChamber) {
373 ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()};
375 mapChamberAMC13Error[key4Ch] =
false;
383 for (
auto amcIt = gemAMC->
begin(); amcIt != gemAMC->
end(); ++amcIt) {
384 int fedId = (*amcIt).first;
392 Bool_t bWarn =
false;
395 Int_t nAMCNum =
amc->amcNumber();
421 if (
errors.DAQclocklocked)
430 if (!bWarn && !bErr) {
432 h2AMCStatus->
Fill(nAMCNum, 1);
436 for (
auto gid : listChamber) {
437 ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()};
439 mapChamberAMCError[key4Ch] =
false;
441 mapChamberAMCWarning[key4Ch] =
false;
447 for (
auto ohIt = gemOH->
begin(); ohIt != gemOH->
end(); ++ohIt) {
453 for (
auto OHStatus =
range.first; OHStatus !=
range.second; ++OHStatus) {
490 Bool_t bWarn =
warnings.wcodes != 0;
491 Bool_t bErr =
errors.codes != 0;
495 mapChamberOHWarning[key4] =
false;
497 mapChamberOHError[key4] =
false;
498 mapChamberAll[key4] =
true;
502 for (
auto vfatIt = gemVFAT->
begin(); vfatIt != gemVFAT->
end(); ++vfatIt) {
508 for (
auto vfatStat =
range.first; vfatStat !=
range.second; ++vfatStat) {
509 Int_t nIdxVFAT = vfatStat->vfatPosition();
527 Bool_t bWarn =
warnings.wcodes != 0;
528 Bool_t bErr =
errors.codes != 0;
532 mapChamberVFATWarning[key4Ch] =
false;
534 mapChamberVFATError[key4Ch] =
false;
539 mapChamberAll[key4Ch] =
true;
545 for (
auto const &[key4, bErr] : mapChamberAll) {
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
constexpr int station() const
MEMapInfT< MEMap4Ids, ME4IdsKey > MEMap4Inf
dqm::impl::MonitorElement * CreateSummaryHist(DQMStore::IBooker &ibooker, TString strName)
int ProcessWithMEMap3WithChamber(BookingHelper &bh, ME4IdsKey key) override
GEMDAQStatusSource(const edm::ParameterSet &cfg)
constexpr int region() const
void FillWithRiseErr(MonitorElement *h, Int_t nX, Int_t nY, Bool_t &bErr)
virtual void setCurrentFolder(std::string const &fullpath)
edm::EDGetToken tagAMC13_
int SetLabelForChambers(K key, Int_t nAxis, Int_t nNumBin=-1, Int_t nIdxStart=1)
MonitorElement * h2SummaryStatusAMCWarning
MEMapInfT< MEMap3Ids, ME3IdsKey > MEMap3Inf
MonitorElement * h2AMC13Status_
std::string strFolderMain_
MonitorElement * h2SummaryStatusAMCError
int initGeometry(edm::EventSetup const &iSetup)
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
std::map< UInt_t, int > mapFEDIdToRe_
int SetLabelForVFATs(K key, Int_t nNumEtaPartitions, Int_t nAxis, Int_t nNumBin=-1)
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
std::map< UInt_t, int > mapFEDIdToSt_
std::map< std::tuple< int, int >, std::vector< GEMDetId > > mapAMCToListChamber_
std::map< ME3IdsKey, int > mapStationToIdx_
constexpr int layer() const
int Fill(K key, Double_t x)
std::string log_category_
constexpr int chamber() const
MonitorElement * h2SummaryStatusVFATError
const edm::ESGetToken< GEMChMap, GEMChMapRcd > gemChMapToken_
MEMap3Inf mapStatusWarnVFATPerLayer_
std::map< UInt_t, MonitorElement * > mapFEDIdToAMCStatus_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * h2SummaryStatusError
MEMap3Inf mapStatusErrVFATPerLayer_
int GenerateMEPerChamber(DQMStore::IBooker &ibooker)
void SetLabelAMCStatus(MonitorElement *h2Status)
void LoadROMap(edm::EventSetup const &iSetup)
std::map< UInt_t, int > mapFEDIdToPosition_
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
#define DEFINE_FWK_MODULE(type)
bool getData(T &iHolder) const
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
DigiRangeIterator begin() const
void SetLabelAMC13Status(MonitorElement *h2Status)
std::map< int, std::vector< GEMDetId > > mapAMC13ToListChamber_
MonitorElement * h2SummaryStatusVFATWarning
MonitorElement * h2SummaryStatusAll
const GEMGeometry * GEMGeometry_
void SetLabelVFATStatus(MonitorElement *h2Status)
std::pair< const_iterator, const_iterator > Range
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void add(std::string const &label, ParameterSetDescription const &psetDescription)
DQMStore::IBooker * getBooker()
int keyToChamber(ME4IdsKey key)
void SetLabelOHStatus(MonitorElement *h2Status)
std::string getNameDirLayer(ME3IdsKey key3)
int bookND(BookingHelper &bh, K key)
MonitorElement * h2SummaryStatusOHWarning
ME3IdsKey key4Tokey3(ME4IdsKey key)
MonitorElement * h2SummaryStatusAMC13Error
MEMap4Inf mapStatusVFATPerCh_
int ProcessWithMEMap3(BookingHelper &bh, ME3IdsKey key) override
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
void SetBinConfX(Int_t nBins, Double_t dL=0.5, Double_t dH=-1048576.0)
MonitorElement * h2SummaryStatusWarning
Log< level::Warning, false > LogWarning
void FillStatusSummaryPlot(std::map< ME4IdsKey, bool > &mapChamber, MonitorElement *h2Plot, std::map< ME4IdsKey, bool > *pmapSummary=nullptr)
MonitorElement * h2SummaryStatusOHError
void SetBinConfY(Int_t nBins, Double_t dL=0.5, Double_t dH=-1048576.0)
dqm::impl::MonitorElement * FindHist(K key)
DigiRangeIterator end() const