File indexing completed on 2024-04-06 12:07:07
0001 #ifndef DTDataIntegrityTask_H
0002 #define DTDataIntegrityTask_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "FWCore/Framework/interface/Frameworkfwd.h"
0016 #include "FWCore/Framework/interface/Event.h"
0017 #include "FWCore/Framework/interface/LuminosityBlock.h"
0018 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0019 #include "FWCore/Utilities/interface/EDGetToken.h"
0020
0021 #include "DQMServices/Core/interface/DQMStore.h"
0022 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0023
0024 #include "DataFormats/DTDigi/interface/DTuROSControlData.h"
0025
0026 #include <fstream>
0027 #include <map>
0028 #include <string>
0029 #include <vector>
0030 #include <list>
0031
0032 namespace dtdi {
0033 struct LumiCache {
0034 int nEventsLS = 0;
0035 };
0036 }
0037
0038 class DTuROSROSData;
0039 class DTuROSFEDData;
0040 class DTTimeEvolutionHisto;
0041
0042 class DTDataIntegrityTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<dtdi::LumiCache>> {
0043 public:
0044 DTDataIntegrityTask(const edm::ParameterSet& ps);
0045
0046 ~DTDataIntegrityTask() override;
0047
0048 void TimeHistos(DQMStore::IBooker&, std::string histoType);
0049
0050 void processuROS(DTuROSROSData& data, int fed, int uRos);
0051 void processFED(DTuROSFEDData& data, int fed);
0052
0053 std::shared_ptr<dtdi::LumiCache> globalBeginLuminosityBlock(const edm::LuminosityBlock& ls,
0054 const edm::EventSetup& es) const override;
0055 void globalEndLuminosityBlock(const edm::LuminosityBlock& ls, const edm::EventSetup& es) override;
0056
0057 void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0058
0059 protected:
0060 void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0061
0062 private:
0063 void bookHistos(DQMStore::IBooker&, const int fedMin, const int fedMax);
0064 void bookHistos(DQMStore::IBooker&, std::string folder, const int fed);
0065 void bookHistosuROS(DQMStore::IBooker&, const int fed, const int uRos);
0066 void bookHistosROS(DQMStore::IBooker&, const int wheel, const int ros);
0067
0068 std::string topFolder(bool isFEDIntegrity) const;
0069
0070
0071 int theDDU(int crate, int slot, int link, bool tenDDU);
0072 int theROS(int slot, int link);
0073
0074
0075 bool doTimeHisto;
0076
0077 int nevents;
0078
0079
0080 MonitorElement* nEventMonitor;
0081
0082 std::map<std::string, std::map<int, MonitorElement*>> fedHistos;
0083
0084 std::map<std::string, std::map<int, MonitorElement*>> summaryHistos;
0085
0086 std::map<unsigned int, MonitorElement*> urosHistos;
0087
0088
0089
0090 enum histoTypes { uROSEventLength = 0, uROSError = 1, TDCError = 4, TTSValues = 7 };
0091
0092
0093 MonitorElement* hFEDEntry;
0094 MonitorElement* hFEDFatal;
0095
0096
0097 std::map<std::string, std::map<int, DTTimeEvolutionHisto*>> fedTimeHistos;
0098
0099 std::map<unsigned int, DTTimeEvolutionHisto*> urosTimeHistos;
0100
0101
0102 #ifdef EDM_ML_DEBUG
0103 int neventsFED;
0104 int neventsuROS;
0105 #endif
0106
0107 const int FEDIDmin;
0108 const int FEDIDmax;
0109
0110 int errorX[6][12][5] = {{{0}}};
0111 int nLinksForFatal;
0112
0113
0114 const int NuROS = 12;
0115
0116
0117 int mode;
0118 std::string fedIntegrityFolder;
0119
0120
0121 edm::EDGetTokenT<DTuROSFEDDataCollection> fedToken;
0122 };
0123
0124 #endif