CMS 3D CMS Logo

DTDataIntegrityTask.h
Go to the documentation of this file.
1 #ifndef DTDataIntegrityTask_H
2 #define DTDataIntegrityTask_H
3 
14 
19 
22 
25 
26 #include <fstream>
27 #include <map>
28 #include <string>
29 #include <vector>
30 #include <list>
31 
32 class DTROS25Data;
33 class DTDDUData;
34 //to remove
35 class DTuROSROSData;
36 class DTuROSFEDData;
38 
39 class DTDataIntegrityTask : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
40 public:
42 
43  ~DTDataIntegrityTask() override;
44 
45  void TimeHistos(DQMStore::IBooker&, std::string histoType);
46 
47  void processuROS(DTuROSROSData& data, int fed, int uRos);
48  void processFED(DTuROSFEDData& data, int fed);
49  void processROS25(DTROS25Data& data, int dduID, int ros);
50  void processFED(DTDDUData& dduData, const std::vector<DTROS25Data>& rosData, int dduID);
51 
52  // log number of times the payload of each fed is unpacked
53  void fedEntry(int dduID);
54  // log number of times the payload of each fed is skipped (no ROS inside)
55  void fedFatal(int dduID);
56  // log number of times the payload of each fed is partially skipped (some ROS skipped)
57  void fedNonFatal(int dduID);
58 
59  bool eventHasErrors() const;
60 
61  void beginLuminosityBlock(const edm::LuminosityBlock& ls, const edm::EventSetup& es) override;
62  void endLuminosityBlock(const edm::LuminosityBlock& ls, const edm::EventSetup& es) override;
63 
64  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
65 
66 protected:
67  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
68 
69 private:
70  void bookHistos(DQMStore::IBooker&, const int fedMin, const int fedMax);
72  void bookHistos(DQMStore::IBooker&, std::string folder, const int fed);
74  void bookHistosuROS(DQMStore::IBooker&, const int fed, const int uRos);
75  void bookHistosROS(DQMStore::IBooker&, const int wheel, const int ros);
76 
77  void channelsInCEROS(int cerosId, int chMask, std::vector<int>& channels);
78  void channelsInROS(int cerosMask, std::vector<int>& channels);
79 
80  std::string topFolder(bool isFEDIntegrity) const;
81 
82  std::multimap<std::string, std::string> names;
83  std::multimap<std::string, std::string>::iterator it;
84 
86 
87  //conversions
88  int theDDU(int crate, int slot, int link, bool tenDDU);
89  int theROS(int slot, int link);
90 
91  //If you want info VS time histos
93  // Plot quantities about SC
94  bool getSCInfo;
95  // Check FEDs from uROS, otherwise standard ROS
96  bool checkUros;
97 
98  int nevents;
99 
101 
102  // Monitor Elements
104  // <histoType, <index , histo> >
105  std::map<std::string, std::map<int, MonitorElement*> > fedHistos;
106  // <histoType, histo> >
107  std::map<std::string, std::map<int, MonitorElement*> > summaryHistos;
108  // <histoType, <index , histo> >
109  std::map<std::string, std::map<int, MonitorElement*> > rosHistos;
110  // <key , histo> >
111  std::map<unsigned int, MonitorElement*> urosHistos;
112  // <histoType, <tdcID, histo> >
113  std::map<std::string, std::map<int, MonitorElement*> > robHistos;
114 
115  //enum histoTypes for reduced map of MEs urosHistos
116  // key = stringEnum*1000 + (fed-minFED)#*100 + (uROS-minuROS)#
118 
119  // standard ME for monitoring of FED integrity
124 
125  // one for all FEDS
127 
128  //time histos for DDU/ROS
129  std::map<std::string, std::map<int, DTTimeEvolutionHisto*> > fedTimeHistos;
130  std::map<std::string, std::map<int, DTTimeEvolutionHisto*> > rosTimeHistos;
131  // <key, histo> >
132  std::map<unsigned int, DTTimeEvolutionHisto*> urosTimeHistos;
133  //key = (fed-minFED)#*100 + (uROS-minuROS)#
134 
136 
139 
142  double rob_max[25];
143  double link_max[72];
144 
145  int FEDIDmin;
146  int FEDIDmax;
147 
148  // Number of ROS/uROS per FED
149  const int NuROS = 12;
150 
151  //Event counter for the graphs VS time
152  int myPrevEv;
153 
154  //Monitor TTS,ROS,FIFO VS time
158 
159  // event error flag: true when errors are detected
160  // can be used for the selection of the debug stream
162 
163  std::map<int, std::set<int> > rosBxIdsPerFED;
164  std::set<int> fedBXIds;
165  std::map<int, std::set<int> > rosL1AIdsPerFED;
166 
167  // flag to toggle the creation of only the summaries (for HLT running)
168  int mode;
170 
171  // The label to retrieve the digis
173 
175 
177 };
178 
179 #endif
180 
181 /* Local Variables: */
182 /* show-trailing-whitespace: t */
183 /* truncate-lines: t */
184 /* End: */
std::map< int, std::set< int > > rosBxIdsPerFED
void bookHistosROS(DQMStore::IBooker &, const int wheel, const int ros)
std::multimap< std::string, std::string > names
std::map< int, std::set< int > > rosL1AIdsPerFED
std::multimap< std::string, std::string >::iterator it
MonitorElement * hFEDNonFatal
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 TimeHistos(DQMStore::IBooker &, std::string histoType)
void processuROS(DTuROSROSData &data, int fed, int uRos)
void channelsInROS(int cerosMask, std::vector< int > &channels)
MonitorElement * hFEDFatal
edm::EDGetTokenT< DTROS25Collection > ros25Token
DTDataIntegrityTask(const edm::ParameterSet &ps)
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
void processROS25(DTROS25Data &data, int dduID, int ros)
std::map< std::string, std::map< int, MonitorElement * > > summaryHistos
int theROS(int slot, int link)
void beginLuminosityBlock(const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
std::map< unsigned int, MonitorElement * > urosHistos
void analyze(const edm::Event &e, const edm::EventSetup &c) override
void endLuminosityBlock(const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
std::map< std::string, std::map< int, MonitorElement * > > robHistos
MonitorElement * nEventMonitor
def ls(path, rec=False)
Definition: eostools.py:349
std::string topFolder(bool isFEDIntegrity) const
MonitorElement * hFEDEntry
std::map< std::string, std::map< int, MonitorElement * > > rosHistos
edm::ParameterSet parameters
void processFED(DTuROSFEDData &data, int fed)
void channelsInCEROS(int cerosId, int chMask, std::vector< int > &channels)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void bookHistosROS25(DQMStore::IBooker &, DTROChainCoding code)
MonitorElement * hTTSSummary
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > rosTimeHistos
std::set< int > fedBXIds
MonitorElement * hCorruptionSummary
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
edm::EDGetTokenT< DTDDUCollection > dduToken
Definition: Run.h:45
int theDDU(int crate, int slot, int link, bool tenDDU)