File indexing completed on 2024-04-06 12:07:44
0001 #ifndef DQM_L1TMonitor_L1GtHwValidation_h
0002 #define DQM_L1TMonitor_L1GtHwValidation_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include <memory>
0022 #include <string>
0023
0024
0025 #include "FWCore/Framework/interface/Frameworkfwd.h"
0026
0027 #include "FWCore/Framework/interface/Event.h"
0028 #include "FWCore/Framework/interface/MakerMacros.h"
0029
0030 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0031 #include "FWCore/Utilities/interface/InputTag.h"
0032
0033 #include "DQMServices/Core/interface/DQMStore.h"
0034
0035 #include "DataFormats/L1GlobalTrigger/interface/L1GtObject.h"
0036 #include "CondFormats/L1TObjects/interface/L1GtDefinitions.h"
0037
0038 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
0039 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerEvmReadoutRecord.h"
0040
0041 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0042
0043
0044 class L1GtfeWord;
0045 class L1GtFdlWord;
0046 class L1GtPsbWord;
0047 class L1TcsWord;
0048 class L1GtTriggerMenu;
0049 class L1GtPrescaleFactors;
0050 class L1GtTriggerMask;
0051 class L1GtPrescaleFactorsTechTrigRcd;
0052 class L1GtPrescaleFactorsAlgoTrigRcd;
0053 class L1GtTriggerMenuRcd;
0054 class L1GtTriggerMaskTechTrigRcd;
0055 class L1GtTriggerMaskAlgoTrigRcd;
0056
0057
0058 class L1GtHwValidation : public DQMEDAnalyzer {
0059 public:
0060 explicit L1GtHwValidation(const edm::ParameterSet&);
0061 ~L1GtHwValidation() override;
0062
0063 private:
0064
0065 virtual void compareGTFE(const edm::Event&, const edm::EventSetup&, const L1GtfeWord&, const L1GtfeWord&, const int);
0066
0067
0068 virtual void compareFDL(const edm::Event&, const edm::EventSetup&, const L1GtFdlWord&, const L1GtFdlWord&, const int);
0069
0070
0071 virtual void comparePSB(const edm::Event&, const edm::EventSetup&, const L1GtPsbWord&, const L1GtPsbWord&);
0072
0073
0074 virtual void compareTCS(const edm::Event&, const edm::EventSetup&, const L1TcsWord&, const L1TcsWord&);
0075
0076
0077 virtual void compareDaqRecord(const edm::Event&, const edm::EventSetup&);
0078
0079
0080 virtual void compareEvmRecord(const edm::Event&, const edm::EventSetup&);
0081
0082
0083
0084 virtual void compareGt_Gct(const edm::Event&, const edm::EventSetup&);
0085
0086
0087
0088
0089
0090
0091 bool matchCondCategory(const L1GtConditionCategory&, const L1GtConditionCategory&);
0092
0093
0094
0095 bool matchCondType(const L1GtConditionType&, const L1GtConditionType&);
0096
0097
0098
0099 bool matchCondL1GtObject(const std::vector<L1GtObject>&, const L1GtObject&);
0100
0101
0102 void excludedAlgoList();
0103
0104
0105 bool excludedAlgo(const int&) const;
0106
0107 void analyze(const edm::Event&, const edm::EventSetup&) override;
0108
0109 protected:
0110 void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const edm::EventSetup&) override;
0111
0112
0113 private:
0114
0115 edm::InputTag m_l1GtDataDaqInputTag;
0116
0117
0118 edm::InputTag m_l1GtDataEvmInputTag;
0119
0120
0121 edm::InputTag m_l1GtEmulDaqInputTag;
0122
0123
0124 edm::InputTag m_l1GtEmulEvmInputTag;
0125
0126
0127 edm::InputTag m_l1GctDataInputTag;
0128
0129
0130 std::string m_dirName;
0131
0132
0133
0134 std::vector<edm::ParameterSet> m_excludeCondCategTypeObject;
0135
0136
0137 std::vector<std::string> m_excludeAlgoTrigByName;
0138
0139
0140 std::vector<int> m_excludeAlgoTrigByBit;
0141
0142 private:
0143
0144 std::vector<L1GtConditionCategory> m_excludedCondCategory;
0145
0146
0147 std::vector<L1GtConditionType> m_excludedCondType;
0148
0149
0150 std::vector<L1GtObject> m_excludedL1GtObject;
0151
0152
0153
0154 std::ostringstream m_myCoutStream;
0155
0156
0157 int m_nrDataEventError;
0158 int m_nrEmulEventError;
0159
0160
0161
0162
0163 const L1GtTriggerMenu* m_l1GtMenu;
0164 unsigned long long m_l1GtMenuCacheID;
0165
0166
0167 const L1GtPrescaleFactors* m_l1GtPfAlgo;
0168 unsigned long long m_l1GtPfAlgoCacheID;
0169
0170 const L1GtPrescaleFactors* m_l1GtPfTech;
0171 unsigned long long m_l1GtPfTechCacheID;
0172
0173 const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
0174 const std::vector<std::vector<int> >* m_prescaleFactorsTechTrig;
0175
0176
0177 const L1GtTriggerMask* m_l1GtTmAlgo;
0178 unsigned long long m_l1GtTmAlgoCacheID;
0179
0180 const L1GtTriggerMask* m_l1GtTmTech;
0181 unsigned long long m_l1GtTmTechCacheID;
0182
0183 std::vector<unsigned int> m_triggerMaskAlgoTrig;
0184 std::vector<unsigned int> m_triggerMaskTechTrig;
0185
0186 private:
0187
0188
0189 bool m_agree;
0190 bool m_dataOnly;
0191 bool m_emulOnly;
0192 bool m_dataOnlyMask;
0193 bool m_emulOnlyMask;
0194
0195 private:
0196 static const int TotalBxInEvent = 5;
0197 static const int NumberOfGtRecords = 2;
0198
0199
0200
0201
0202 MonitorElement* m_gtfeDataEmul[NumberOfGtRecords];
0203
0204
0205 MonitorElement* m_fdlDataEmul[TotalBxInEvent][NumberOfGtRecords];
0206
0207 MonitorElement* m_fdlDataAlgoDecision[TotalBxInEvent][NumberOfGtRecords];
0208 MonitorElement* m_fdlDataAlgoDecisionPrescaled[TotalBxInEvent][NumberOfGtRecords];
0209 MonitorElement* m_fdlDataAlgoDecisionUnprescaled[TotalBxInEvent][NumberOfGtRecords];
0210 MonitorElement* m_fdlDataAlgoDecisionMask[TotalBxInEvent][NumberOfGtRecords];
0211 MonitorElement* m_fdlDataAlgoDecision_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0212 MonitorElement* m_fdlDataAlgoDecisionPrescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0213 MonitorElement* m_fdlDataAlgoDecisionUnprescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0214 MonitorElement* m_fdlDataAlgoDecisionMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0215 MonitorElement* m_fdlDataAlgoDecisionPrescaledMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0216 MonitorElement* m_fdlDataAlgoDecisionUnprescaledMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0217 MonitorElement* m_fdlDataAlgoDecision_Err[NumberOfGtRecords];
0218
0219 MonitorElement* m_fdlEmulAlgoDecision[TotalBxInEvent][NumberOfGtRecords];
0220 MonitorElement* m_fdlEmulAlgoDecisionPrescaled[TotalBxInEvent][NumberOfGtRecords];
0221 MonitorElement* m_fdlEmulAlgoDecisionUnprescaled[TotalBxInEvent][NumberOfGtRecords];
0222 MonitorElement* m_fdlEmulAlgoDecisionMask[TotalBxInEvent][NumberOfGtRecords];
0223 MonitorElement* m_fdlEmulAlgoDecision_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0224 MonitorElement* m_fdlEmulAlgoDecisionPrescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0225 MonitorElement* m_fdlEmulAlgoDecisionUnprescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0226 MonitorElement* m_fdlEmulAlgoDecisionMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0227 MonitorElement* m_fdlEmulAlgoDecisionPrescaledMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0228 MonitorElement* m_fdlEmulAlgoDecisionUnprescaledMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
0229 MonitorElement* m_fdlEmulAlgoDecision_Err[NumberOfGtRecords];
0230
0231
0232 MonitorElement* m_fdlDataEmulAlgoDecision[TotalBxInEvent][NumberOfGtRecords];
0233 MonitorElement* m_fdlDataEmulAlgoDecisionPrescaled[TotalBxInEvent][NumberOfGtRecords];
0234 MonitorElement* m_fdlDataEmulAlgoDecisionUnprescaled[TotalBxInEvent][NumberOfGtRecords];
0235 MonitorElement* m_fdlDataEmulAlgoDecisionUnprescaledAllowed[TotalBxInEvent][NumberOfGtRecords];
0236 MonitorElement* m_fdlDataEmulAlgoDecisionMask[TotalBxInEvent][NumberOfGtRecords];
0237 MonitorElement* m_fdlDataEmulAlgoDecision_Err[NumberOfGtRecords];
0238 MonitorElement* m_fdlDataEmul_Err[NumberOfGtRecords];
0239
0240
0241 MonitorElement* m_fdlDataTechDecision[TotalBxInEvent][NumberOfGtRecords];
0242 MonitorElement* m_fdlDataTechDecisionMask[TotalBxInEvent][NumberOfGtRecords];
0243 MonitorElement* m_fdlDataTechDecision_Err[NumberOfGtRecords];
0244
0245 MonitorElement* m_fdlEmulTechDecision[TotalBxInEvent][NumberOfGtRecords];
0246 MonitorElement* m_fdlEmulTechDecisionMask[TotalBxInEvent][NumberOfGtRecords];
0247 MonitorElement* m_fdlEmulTechDecision_Err[NumberOfGtRecords];
0248
0249 MonitorElement* m_fdlDataEmulTechDecision[TotalBxInEvent][NumberOfGtRecords];
0250 MonitorElement* m_fdlDataEmulTechDecisionMask[TotalBxInEvent][NumberOfGtRecords];
0251 MonitorElement* m_fdlDataEmulTechDecision_Err[NumberOfGtRecords];
0252
0253 MonitorElement* m_excludedAlgorithmsAgreement;
0254
0255
0256
0257
0258
0259
0260 MonitorElement* m_gtErrorFlag;
0261
0262
0263 int m_nrEvJob;
0264 int m_nrEvRun;
0265
0266 std::vector<int> m_excludedAlgoList;
0267
0268
0269 edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> m_l1GtDataDaqInputToken_;
0270 edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> m_l1GtEmulDaqInputToken_;
0271 edm::EDGetTokenT<L1GlobalTriggerEvmReadoutRecord> m_l1GtDataEvmInputToken_;
0272 edm::EDGetTokenT<L1GlobalTriggerEvmReadoutRecord> m_l1GtEmulEvmInputToken_;
0273 edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsTechTrigRcd> l1gtPrescaleTechToken_;
0274 edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd> l1gtPrescaleAlgoToken_;
0275 edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> l1gtTrigmenuToken_;
0276 edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd> l1gtTrigmaskTechToken_;
0277 edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd> l1gtTrigmaskAlgoToken_;
0278 };
0279
0280 #endif