22 ecalTPSourceRecdLabel_(ps.getParameter<
edm::InputTag>(
"ecalTPSourceRecd").
label()),
24 hcalTPSourceRecdLabel_(ps.getParameter<
edm::InputTag>(
"hcalTPSourceRecd").
label()),
26 ecalTPSourceSentLabel_(ps.getParameter<
edm::InputTag>(
"ecalTPSourceSent").
label()),
28 hcalTPSourceSentLabel_(ps.getParameter<
edm::InputTag>(
"hcalTPSourceSent").
label()),
30 histFolder_(ps.getParameter<
std::
string>(
"histFolder")),
31 tpFillThreshold_(ps.getUntrackedParameter<
int>(
"etDistributionsFillThreshold", 0)),
32 ignoreHFfbs_(ps.getUntrackedParameter<
bool>(
"ignoreHFfbs",
false))
51 event.getByToken(
fedRawData_, fedRawDataCollection);
52 bool caloLayer1OutOfRun{
true};
53 if (fedRawDataCollection.
isValid()) {
54 caloLayer1OutOfRun =
false;
55 for(
int iFed=1354; iFed<1360; iFed+=2) {
57 if ( fedRawData.
size() == 0 ) {
58 caloLayer1OutOfRun =
true;
63 for(uint32_t
i = 0;
i < daqData.
nAMCs();
i++) {
66 if ( daqData.
BXID() != amcData.BXID() ) {
69 if ( daqData.
L1ID() != amcData.L1ID() ) {
73 if ( (daqData.
orbitNumber() & 0xFFFF) != amcData.orbitNo() ) {
89 ecalTPsRecd->
begin(), ecalTPsRecd->
end(),
92 int nEcalLinkErrors{0};
96 auto sentTp = tpPair.first;
97 if ( sentTp.compressedEt() < 0 ) {
103 tpg.setSample(0, sample);
106 const auto& recdTp = tpPair.second;
107 const int ieta = sentTp.id().ieta();
108 const int iphi = sentTp.id().iphi();
109 const bool towerMasked = recdTp.sample(0).raw() & (1<<13);
110 const bool linkMasked = recdTp.sample(0).raw() & (1<<14);
111 const bool linkError = recdTp.sample(0).raw() & (1<<15);
125 if(sentTp.fineGrain()==1){
129 if ( towerMasked || caloLayer1OutOfRun ) {
149 if(recdTp.fineGrain()==1){
155 const bool EetAgreement = sentTp.compressedEt() == recdTp.compressedEt();
156 const bool EfbAgreement = sentTp.fineGrain() == recdTp.fineGrain();
157 if ( EetAgreement && EfbAgreement ) {
171 if ( not EetAgreement ) {
180 if ( not EfbAgreement ) {
205 hcalTPsRecd->
begin(), hcalTPsRecd->
end(),
208 int nHcalLinkErrors{0};
209 int nHcalMismatch{0};
212 const auto& sentTp = tpPair.first;
213 const auto& recdTp = tpPair.second;
214 const int ieta = sentTp.id().ieta();
215 if (
abs(ieta) > 28 && sentTp.id().version() != 1 )
continue;
216 const int iphi = sentTp.id().iphi();
217 const bool towerMasked = recdTp.sample(0).raw() & (1<<13);
218 const bool linkMasked = recdTp.sample(0).raw() & (1<<14);
219 const bool linkError = recdTp.sample(0).raw() & (1<<15);
232 if(sentTp.SOI_fineGrain()==1){
235 if(sentTp.t0().fineGrain(1)==1){
239 if ( towerMasked || caloLayer1OutOfRun ) {
257 if(recdTp.SOI_fineGrain()){
260 if(recdTp.t0().fineGrain(1)){
264 if (
abs(ieta) > 29 ) {
270 const bool HetAgreement = sentTp.SOI_compressedEt() == recdTp.SOI_compressedEt();
271 const bool Hfb1Agreement = (
abs(ieta) < 29 ) ?
true : (recdTp.SOI_compressedEt()==0 || (sentTp.SOI_fineGrain() == recdTp.SOI_fineGrain()) ||
ignoreHFfbs_);
273 const bool Hfb2Agreement = (
abs(ieta) < 29 ) ?
true : (recdTp.SOI_compressedEt()==0 || (sentTp.SOI_fineGrain(1) == recdTp.SOI_fineGrain(1)) ||
ignoreHFfbs_);
274 if ( HetAgreement && Hfb1Agreement && Hfb2Agreement ) {
287 if ( not HetAgreement ) {
288 if (
abs(ieta) > 29 ) {
302 if ( not Hfb1Agreement ) {
307 if ( not Hfb2Agreement ) {
329 std::string eventString{std::to_string(
id.
run()) +
":" + std::to_string(
id.luminosityBlock()) +
":" + std::to_string(
id.
event())};
344 for (
size_t ibin=1, imatch=
lastMismatchIndex_; ibin<=20; ibin++, imatch=(imatch+19)%20) {
346 for(
int itype=0; itype<
h->GetNbinsX(); ++itype) {
396 return ibooker.
book1D(name,
title+
";Raw ET;Counts", 256, -0.5, 255.5);
399 return ibooker.
book2D(name,
title, 256, -0.5, 255.5, 256, -0.5, 255.5);
402 return ibooker.
book1D(name,
title+
";#Delta Raw ET;Counts", 511, -255.5, 255.5);
405 return ibooker.
book2D(name,
title+
";iEta;iPhi", 57, -28.5, 28.5, 72, 0.5, 72.5);
408 return ibooker.
book2D(name,
title+
";iEta;iPhi", 83, -41.5, 41.5, 72, 0.5, 72.5);
413 ecalDiscrepancy_ = bookEcalOccupancy(
"ecalDiscrepancy",
"ECAL Discrepancies between TCC and Layer1 Readout");
414 ecalLinkError_ = bookEcalOccupancy(
"ecalLinkError",
"ECAL Link Errors");
415 ecalOccupancy_ = bookEcalOccupancy(
"ecalOccupancy",
"ECAL TP Occupancy at Layer1");
416 ecalOccRecdEtWgt_= bookEcalOccupancy(
"ecalOccRecdEtWgt",
"ECal TP ET-weighted Occupancy at Layer1");
417 hcalDiscrepancy_ = bookHcalOccupancy(
"hcalDiscrepancy",
"HCAL Discrepancies between uHTR and Layer1 Readout");
418 hcalLinkError_ = bookHcalOccupancy(
"hcalLinkError",
"HCAL Link Errors");
419 hcalOccupancy_ = bookHcalOccupancy(
"hcalOccupancy",
"HCAL TP Occupancy at Layer1");
420 hcalOccRecdEtWgt_= bookHcalOccupancy(
"hcalOccRecdEtWgt",
"HCal TP ET-weighted Occupancy at Layer1");
426 ecalOccFgDiscrepancy_ = bookEcalOccupancy(
"ecalOccFgDiscrepancy",
"ECal FG Veto Bit Discrepancy Occupancy");
428 ecalOccRecdFgVB_ = bookEcalOccupancy(
"ecalOccRecdFgVB",
"ECal FineGrain Veto Bit Occupancy at Layer1");
429 ecalOccSentAndRecd_ = bookEcalOccupancy(
"ecalOccSentAndRecd",
"ECal TP Occupancy FULL MATCH");
430 ecalOccSentFgVB_ = bookEcalOccupancy(
"ecalOccSentFgVB",
"ECal FineGrain Veto Bit Occupancy at TCC");
431 ecalOccSent_ = bookEcalOccupancy(
"ecalOccSent",
"ECal TP Occupancy at TCC");
433 ecalTPRawEtCorrelation_ = bookEtCorrelation(
"ecalTPRawEtCorrelation",
"Raw Et correlation TCC and Layer1;TCC Et;Layer1 Et");
440 ecalOccSentNotRecd_ = bookHcalOccupancy(
"ecalOccSentNotRecd",
"ECal TP Occupancy sent by TCC, zero at Layer1");
441 ecalOccRecdNotSent_ = bookHcalOccupancy(
"ecalOccRecdNotSent",
"ECal TP Occupancy received by Layer1, zero at TCC");
442 ecalOccNoMatch_ = bookHcalOccupancy(
"ecalOccNoMatch",
"ECal TP Occupancy for TCC and Layer1 nonzero, not matching");
448 hcalOccFbDiscrepancy_ = bookHcalOccupancy(
"hcalOccFbDiscrepancy",
"HCal Feature Bit Discrepancy Occupancy");
449 hcalOccFb2Discrepancy_ = bookHcalOccupancy(
"hcalOccFb2Discrepancy",
"HCal Second Feature Bit Discrepancy Occupancy");
451 hcalOccRecdFb_ = bookHcalOccupancy(
"hcalOccRecdFb",
"HCal Feature Bit Occupancy at Layer1");
452 hcalOccRecdFb2_ = bookHcalOccupancy(
"hcalOccRecdFb2",
"HF Second Feature Bit Occupancy at Layer1");
453 hcalOccSentAndRecd_ = bookHcalOccupancy(
"hcalOccSentAndRecd",
"HCal TP Occupancy FULL MATCH");
454 hcalOccSentFb_ = bookHcalOccupancy(
"hcalOccSentFb",
"HCal Feature Bit Occupancy at uHTR");
455 hcalOccSentFb2_ = bookHcalOccupancy(
"hcalOccSentFb2",
"HF Second Feature Bit Occupancy at uHTR");
456 hcalOccSent_ = bookHcalOccupancy(
"hcalOccSent",
"HCal TP Occupancy at uHTR");
458 hcalTPRawEtCorrelationHBHE_= bookEtCorrelation(
"hcalTPRawEtCorrelationHBHE",
"HBHE Raw Et correlation uHTR and Layer1;uHTR Et;Layer1 Et");
459 hcalTPRawEtCorrelationHF_ = bookEtCorrelation(
"hcalTPRawEtCorrelationHF",
"HF Raw Et correlation uHTR and Layer1;uHTR Et;Layer1 Et");
466 hcalOccSentNotRecd_ = bookHcalOccupancy(
"hcalOccSentNotRecd",
"HCal TP Occupancy sent by uHTR, zero at Layer1");
467 hcalOccRecdNotSent_ = bookHcalOccupancy(
"hcalOccRecdNotSent",
"HCal TP Occupancy received by Layer1, zero at uHTR");
468 hcalOccNoMatch_ = bookHcalOccupancy(
"hcalOccNoMatch",
"HCal TP Occupancy for uHTR and Layer1 nonzero, not matching");
472 const int nMismatchTypes = 4;
474 "Log of last 20 mismatches (use json tool to copy/paste)",
475 nMismatchTypes, 0, nMismatchTypes, 20, 0, 20);
483 const int nLumis = 2000;
484 ecalLinkErrorByLumi_ = ibooker.
book1D(
"ecalLinkErrorByLumi",
"Link error counts per lumi section for ECAL;LumiSection;Counts", nLumis, .5, nLumis+0.5);
485 ecalMismatchByLumi_ = ibooker.
book1D(
"ecalMismatchByLumi",
"Mismatch counts per lumi section for ECAL;LumiSection;Counts", nLumis, .5, nLumis+0.5);
486 hcalLinkErrorByLumi_ = ibooker.
book1D(
"hcalLinkErrorByLumi",
"Link error counts per lumi section for HCAL;LumiSection;Counts", nLumis, .5, nLumis+0.5);
487 hcalMismatchByLumi_ = ibooker.
book1D(
"hcalMismatchByLumi",
"Mismatch counts per lumi section for HCAL;LumiSection;Counts", nLumis, .5, nLumis+0.5);
489 ECALmismatchesPerBx_ = ibooker.
book1D(
"ECALmismatchesPerBx",
"Mismatch counts per bunch crossing for ECAL", 3564, -.5, 3563.5);
490 HBHEmismatchesPerBx_ = ibooker.
book1D(
"HBHEmismatchesPerBx",
"Mismatch counts per bunch crossing for HBHE", 3564, -.5, 3563.5);
491 HFmismatchesPerBx_ = ibooker.
book1D(
"HFmismatchesPerBx",
"Mismatch counts per bunch crossing for HF", 3564, -.5, 3563.5);
493 maxEvtLinkErrorsByLumiECAL_ = ibooker.
book1D(
"maxEvtLinkErrorsByLumiECAL",
"Max number of single-event ECAL link errors per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
494 maxEvtLinkErrorsByLumiHCAL_ = ibooker.
book1D(
"maxEvtLinkErrorsByLumiHCAL",
"Max number of single-event HCAL link errors per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
496 maxEvtMismatchByLumiECAL_ = ibooker.
book1D(
"maxEvtMismatchByLumiECAL",
"Max number of single-event ECAL discrepancies per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
497 maxEvtMismatchByLumiHCAL_ = ibooker.
book1D(
"maxEvtMismatchByLumiHCAL",
"Max number of single-event HCAL discrepancies per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
500 maxEvtLinkErrorsByLumi_ = ibooker.
book1D(
"maxEvtLinkErrorsByLumi",
"Max number of single-event link errors per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
501 maxEvtMismatchByLumi_ = ibooker.
book1D(
"maxEvtMismatchByLumi",
"Max number of single-event discrepancies per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
504 bxidErrors_ = ibooker.
book1D(
"bxidErrors",
"bxid mismatch between AMC13 and CTP Cards;Layer1 Phi;Counts", 18, -.5, 17.5);
505 l1idErrors_ = ibooker.
book1D(
"l1idErrors",
"l1id mismatch between AMC13 and CTP Cards;Layer1 Phi;Counts", 18, -.5, 17.5);
506 orbitErrors_ = ibooker.
book1D(
"orbitErrors",
"orbit mismatch between AMC13 and CTP Cards;Layer1 Phi;Counts", 18, -.5, 17.5);
MonitorElement * hcalTPRawEtRecd_
LuminosityBlockID id() const
MonitorElement * ecalOccTowerMasked_
MonitorElement * ecalOccRecdNotSent_
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * ecalTPRawEtCorrelation_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPSourceSent_
std::vector< std::pair< HcalTriggerPrimitiveDigi, HcalTriggerPrimitiveDigi > > hcalTPSentRecd_
MonitorElement * maxEvtMismatchByLumiHCAL_
MonitorElement * maxEvtLinkErrorsByLumi_
MonitorElement * maxEvtMismatchByLumi_
MonitorElement * ecalOccRecdFgVB_
MonitorElement * ecalTPRawEtSentAndRecd_
MonitorElement * ecalOccFgDiscrepancy_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * ecalMismatchByLumi_
MonitorElement * bxidErrors_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPSourceRecd_
MonitorElement * maxEvtLinkErrorsByLumiHCAL_
MonitorElement * hcalOccSentFb2_
MonitorElement * HBHEmismatchesPerBx_
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalTPSourceRecd_
MonitorElement * hcalOccSentFb_
MonitorElement * hcalOccTowerMasked_
MonitorElement * maxEvtMismatchByLumiECAL_
int bunchCrossing() const
MonitorElement * ecalOccSentFgVB_
MonitorElement * hcalOccupancy_
MonitorElement * hcalLinkErrorByLumi_
MonitorElement * hcalTPRawEtSentAndRecd_
MonitorElement * hcalMismatchByLumi_
MonitorElement * hcalOccRecdEtWgt_
MonitorElement * ECALmismatchesPerBx_
std::array< std::pair< std::string, int >, 20 > last20MismatchArray_
MonitorElement * ecalOccupancy_
MonitorElement * hcalOccRecdNotSent_
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * hcalOccLinkMasked_
size_t size() const
Lenght of the data buffer in bytes.
void swap(Association< C > &lhs, Association< C > &rhs)
MonitorElement * ecalTPRawEtRecd_
MonitorElement * ecalTPRawEtDiffNoMatch_
MonitorElement * hcalOccSent_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void setCurrentFolder(std::string const &fullpath)
MonitorElement * ecalOccNoMatch_
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
MonitorElement * ecalTPRawEtSent_
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
MonitorElement * ecalOccSentAndRecd_
L1TStage2CaloLayer1(const edm::ParameterSet &ps)
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
MonitorElement * ecalLinkErrorByLumi_
int maxEvtMismatchHCALCurrentLumi_
MonitorElement * hcalOccEtDiscrepancy_
MonitorElement * hcalTPRawEtCorrelationHBHE_
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
void updateMismatch(const edm::Event &e, int mismatchType)
MonitorElement * ecalOccSent_
std::vector< std::pair< EcalTriggerPrimitiveDigi, EcalTriggerPrimitiveDigi > > ecalTPSentRecd_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
MonitorElement * hcalOccSentAndRecd_
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * l1idErrors_
MonitorElement * ecalDiscrepancy_
const_iterator end() const
MonitorElement * hcalOccFbDiscrepancy_
const uint32_t * amcPayload(uint32_t amc)
unsigned long long uint64_t
MonitorElement * book2D(Args &&...args)
MonitorElement * hcalOccFb2Discrepancy_
LuminosityBlockNumber_t luminosityBlock() const
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
MonitorElement * hcalTPRawEtSent_
~L1TStage2CaloLayer1() override
MonitorElement * hcalOccRecdFb2_
MonitorElement * hcalTPRawEtCorrelationHF_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * ecalLinkError_
int maxEvtLinkErrorsHCALCurrentLumi_
MonitorElement * hcalOccRecdFb_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
MonitorElement * last20Mismatches_
MonitorElement * hcalTPRawEtDiffNoMatch_
MonitorElement * ecalOccEtDiscrepancy_
MonitorElement * maxEvtLinkErrorsByLumiECAL_
MonitorElement * ecalOccRecdEtWgt_
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalTPSourceSent_
size_t lastMismatchIndex_
MonitorElement * HFmismatchesPerBx_
int maxEvtMismatchECALCurrentLumi_
MonitorElement * ecalOccLinkMasked_
int maxEvtLinkErrorsECALCurrentLumi_
edm::EDGetTokenT< FEDRawDataCollection > fedRawData_
MonitorElement * hcalOccNoMatch_
MonitorElement * hcalOccSentNotRecd_
MonitorElement * hcalLinkError_
MonitorElement * ecalOccSentNotRecd_
const_iterator begin() const
MonitorElement * orbitErrors_
MonitorElement * hcalDiscrepancy_