CMS 3D CMS Logo

DTDataIntegrityTask.h
Go to the documentation of this file.
1 #ifndef DTDataIntegrityTask_H
2 #define DTDataIntegrityTask_H
3 
20 
23 
25 
26 #include <fstream>
27 #include <map>
28 #include <string>
29 #include <vector>
30 #include <list>
31 
32 namespace dtdi {
33  struct LumiCache {
34  int nEventsLS = 0;
35  };
36 } // namespace dtdi
37 
38 class DTuROSROSData;
39 class DTuROSFEDData;
41 
42 class DTDataIntegrityTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<dtdi::LumiCache>> {
43 public:
45 
46  ~DTDataIntegrityTask() override;
47 
48  void TimeHistos(DQMStore::IBooker&, std::string histoType);
49 
50  void processuROS(DTuROSROSData& data, int fed, int uRos);
51  void processFED(DTuROSFEDData& data, int fed);
52 
53  std::shared_ptr<dtdi::LumiCache> globalBeginLuminosityBlock(const edm::LuminosityBlock& ls,
54  const edm::EventSetup& es) const override;
55  void globalEndLuminosityBlock(const edm::LuminosityBlock& ls, const edm::EventSetup& es) override;
56 
57  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
58 
59 protected:
60  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
61 
62 private:
63  void bookHistos(DQMStore::IBooker&, const int fedMin, const int fedMax);
64  void bookHistos(DQMStore::IBooker&, std::string folder, const int fed);
65  void bookHistosuROS(DQMStore::IBooker&, const int fed, const int uRos);
66  void bookHistosROS(DQMStore::IBooker&, const int wheel, const int ros);
67 
68  std::string topFolder(bool isFEDIntegrity) const;
69 
70  //conversions
71  int theDDU(int crate, int slot, int link, bool tenDDU);
72  int theROS(int slot, int link);
73 
74  //If you want info VS time histos
76 
77  int nevents;
78 
79  // Monitor Elements
81  // <histoType, <index , histo> >
82  std::map<std::string, std::map<int, MonitorElement*>> fedHistos;
83  // <histoType, histo> >
84  std::map<std::string, std::map<int, MonitorElement*>> summaryHistos;
85  // <key , histo> >
86  std::map<unsigned int, MonitorElement*> urosHistos;
87 
88  //enum histoTypes for reduced map of MEs urosHistos
89  // key = stringEnum*1000 + (fed-minFED)#*100 + (uROS-minuROS)#
90  enum histoTypes { uROSEventLength = 0, uROSError = 1, TDCError = 4, TTSValues = 7 };
91 
92  // standard ME for monitoring of FED integrity
95 
96  //time histos for FEDs/uROS
97  std::map<std::string, std::map<int, DTTimeEvolutionHisto*>> fedTimeHistos;
98  // <key, histo> >
99  std::map<unsigned int, DTTimeEvolutionHisto*> urosTimeHistos;
100  //key = (fed-minFED)#*100 + (uROS-minuROS)#
101 
102 #ifdef EDM_ML_DEBUG
103  int neventsFED;
104  int neventsuROS;
105 #endif
106 
107  const int FEDIDmin;
108  const int FEDIDmax;
109 
110  int errorX[6][12][5] = {{{0}}}; //5th is notOK flag and 6th is TDC Fatal; Second index is ROS. Last index is wheel
111  int nLinksForFatal; //Minumum number of Links/wheel with notOKFlag or TDC fatal errors to consider a FEDfatal event
112 
113  // Number of uROS per FED
114  const int NuROS = 12;
115 
116  // flag to toggle the creation of only the summaries (for HLT running)
117  int mode;
119 
120  // The label to retrieve the digis
122 };
123 
124 #endif
void bookHistosROS(DQMStore::IBooker &, const int wheel, const int ros)
void bookHistosuROS(DQMStore::IBooker &, const int fed, const int uRos)
void bookHistos(DQMStore::IBooker &, const int fedMin, const int fedMax)
edm::EDGetTokenT< DTuROSFEDDataCollection > fedToken
void globalEndLuminosityBlock(const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
void TimeHistos(DQMStore::IBooker &, std::string histoType)
void processuROS(DTuROSROSData &data, int fed, int uRos)
MonitorElement * hFEDFatal
DTDataIntegrityTask(const edm::ParameterSet &ps)
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
std::map< std::string, std::map< int, MonitorElement * > > summaryHistos
int theROS(int slot, int link)
std::map< unsigned int, MonitorElement * > urosHistos
void analyze(const edm::Event &e, const edm::EventSetup &c) override
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
MonitorElement * nEventMonitor
def ls(path, rec=False)
Definition: eostools.py:349
MonitorElement * hFEDEntry
void processFED(DTuROSFEDData &data, int fed)
std::shared_ptr< dtdi::LumiCache > globalBeginLuminosityBlock(const edm::LuminosityBlock &ls, const edm::EventSetup &es) const override
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
Definition: Run.h:45
int theDDU(int crate, int slot, int link, bool tenDDU)
std::string topFolder(bool isFEDIntegrity) const