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 Void {};
34 } // namespace dtdi
35 
36 class DTuROSROSData;
37 class DTuROSFEDData;
39 
40 class DTDataIntegrityTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<dtdi::Void>> {
41 public:
43 
44  ~DTDataIntegrityTask() override;
45 
46  void TimeHistos(DQMStore::IBooker&, std::string histoType);
47 
48  void processuROS(DTuROSROSData& data, int fed, int uRos);
49  void processFED(DTuROSFEDData& data, int fed);
50 
51  std::shared_ptr<dtdi::Void> globalBeginLuminosityBlock(const edm::LuminosityBlock& ls,
52  const edm::EventSetup& es) const override;
53  void globalEndLuminosityBlock(const edm::LuminosityBlock& ls, const edm::EventSetup& es) override;
54 
55  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
56 
57 protected:
58  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
59 
60 private:
61  void bookHistos(DQMStore::IBooker&, const int fedMin, const int fedMax);
62  void bookHistos(DQMStore::IBooker&, std::string folder, const int fed);
63  void bookHistosuROS(DQMStore::IBooker&, const int fed, const int uRos);
64  void bookHistosROS(DQMStore::IBooker&, const int wheel, const int ros);
65 
66  std::string topFolder(bool isFEDIntegrity) const;
67 
68  //conversions
69  int theDDU(int crate, int slot, int link, bool tenDDU);
70  int theROS(int slot, int link);
71 
72  //If you want info VS time histos
74 
75  int nevents;
76 
77  // Monitor Elements
79  // <histoType, <index , histo> >
80  std::map<std::string, std::map<int, MonitorElement*>> fedHistos;
81  // <histoType, histo> >
82  std::map<std::string, std::map<int, MonitorElement*>> summaryHistos;
83  // <key , histo> >
84  std::map<unsigned int, MonitorElement*> urosHistos;
85 
86  //enum histoTypes for reduced map of MEs urosHistos
87  // key = stringEnum*1000 + (fed-minFED)#*100 + (uROS-minuROS)#
88  enum histoTypes { uROSEventLength = 0, uROSError = 1, TDCError = 4, TTSValues = 7 };
89 
90  // standard ME for monitoring of FED integrity
93 
94  //time histos for FEDs/uROS
95  std::map<std::string, std::map<int, DTTimeEvolutionHisto*>> fedTimeHistos;
96  // <key, histo> >
97  std::map<unsigned int, DTTimeEvolutionHisto*> urosTimeHistos;
98  //key = (fed-minFED)#*100 + (uROS-minuROS)#
99 
100  mutable int nEventsLS;
101 
104 
105  int FEDIDmin;
106  int FEDIDmax;
107 
108  int errorX[6][12][5] = {{{0}}}; //5th is notOK flag and 6th is TDC Fatal; Second index is ROS. Last index is wheel
109  int nLinksForFatal; //Minumum number of Links/wheel with notOKFlag or TDC fatal errors to consider a FEDfatal event
110 
111  // Number of uROS per FED
112  const int NuROS = 12;
113 
114  // flag to toggle the creation of only the summaries (for HLT running)
115  int mode;
117 
118  // The label to retrieve the digis
120 };
121 
122 #endif
123 
124 /* Local Variables: */
125 /* show-trailing-whitespace: t */
126 /* truncate-lines: t */
127 /* End: */
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
std::shared_ptr< dtdi::Void > globalBeginLuminosityBlock(const edm::LuminosityBlock &ls, const edm::EventSetup &es) const override
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)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
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