CMS 3D CMS Logo

DTDataIntegrityTask.h
Go to the documentation of this file.
1 #ifndef DTDataIntegrityTask_H
2 #define DTDataIntegrityTask_H
3 
14 
19 
23 
27 
29 
30 #include <fstream>
31 #include <map>
32 #include <string>
33 #include <vector>
34 #include <list>
35 
36 class DTROS25Data;
37 class DTDDUData;
38 //to remove
39 class DTuROSROSData;
40 class DTuROSFEDData;
42 
43 class DTDataIntegrityTask: public one::DQMEDAnalyzer<edm::one::WatchLuminosityBlocks> {
44 
45 public:
46 
48 
49  ~DTDataIntegrityTask() override;
50 
51  void TimeHistos(DQMStore::IBooker &, std::string histoType);
52 
53  void processuROS(DTuROSROSData & data, int fed, int uRos);
54  void processFED(DTuROSFEDData & data, int fed);
55  void processROS25(DTROS25Data & data, int dduID, int ros);
56  void processFED(DTDDUData & dduData, const std::vector<DTROS25Data> & rosData, int dduID);
57 
58  // log number of times the payload of each fed is unpacked
59  void fedEntry(int dduID);
60  // log number of times the payload of each fed is skipped (no ROS inside)
61  void fedFatal(int dduID);
62  // log number of times the payload of each fed is partially skipped (some ROS skipped)
63  void fedNonFatal(int dduID);
64 
65  bool eventHasErrors() const;
66 
67  void beginLuminosityBlock(const edm::LuminosityBlock& ls, const edm::EventSetup& es) override;
68  void endLuminosityBlock(const edm::LuminosityBlock& ls, const edm::EventSetup& es) override;
69 
70  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
71 
72 protected:
73 
74  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
75 
76 private:
77 
78  void bookHistos(DQMStore::IBooker &, const int fedMin, const int fedMax);
80  void bookHistos(DQMStore::IBooker &, std::string folder, const int fed);
82  void bookHistosuROS(DQMStore::IBooker &,const int fed, const int uRos);
83  void bookHistosROS(DQMStore::IBooker &,const int wheel, const int ros);
84 
85  void channelsInCEROS(int cerosId, int chMask, std::vector<int>& channels);
86  void channelsInROS(int cerosMask, std::vector<int>& channels);
87 
88  std::string topFolder(bool isFEDIntegrity) const;
89 
90  std::multimap<std::string, std::string> names;
91  std::multimap<std::string, std::string>::iterator it;
92 
94 
95  //conversions
96  int theDDU(int crate, int slot, int link, bool tenDDU);
97  int theROS(int slot, int link);
98 
99  //If you want info VS time histos
101  // Plot quantities about SC
102  bool getSCInfo;
103  // Check FEDs from uROS, otherwise standard ROS
104  bool checkUros;
105 
106  int nevents;
107 
109 
110  // Monitor Elements
112  // <histoType, <index , histo> >
113  std::map<std::string, std::map<int, MonitorElement*> > fedHistos;
114  // <histoType, histo> >
115  std::map<std::string, std::map<int, MonitorElement*> > summaryHistos;
116  // <histoType, <index , histo> >
117  std::map<std::string, std::map<int, MonitorElement*> > rosHistos;
118  // <key , histo> >
119  std::map<unsigned int, MonitorElement*> urosHistos;
120  // <histoType, <tdcID, histo> >
121  std::map<std::string, std::map<int, MonitorElement*> > robHistos;
122 
123  //enum histoTypes for reduced map of MEs urosHistos
124  // key = stringEnum*1000 + (fed-minFED)#*100 + (uROS-minuROS)#
126 
127  // standard ME for monitoring of FED integrity
132 
133  // one for all FEDS
135 
136  //time histos for DDU/ROS
137  std::map<std::string, std::map<int, DTTimeEvolutionHisto*> > fedTimeHistos;
138  std::map<std::string, std::map<int, DTTimeEvolutionHisto*> > rosTimeHistos;
139  // <key, histo> >
140  std::map<unsigned int, DTTimeEvolutionHisto*> urosTimeHistos;
141  //key = (fed-minFED)#*100 + (uROS-minuROS)#
142 
144 
147 
150  double rob_max[25];
151  double link_max[72];
152 
153  int FEDIDmin;
154  int FEDIDmax;
155 
156  // Number of ROS/uROS per FED
157  const int NuROS = 12;
158 
159  //Event counter for the graphs VS time
160  int myPrevEv;
161 
162  //Monitor TTS,ROS,FIFO VS time
166 
167  // event error flag: true when errors are detected
168  // can be used for the selection of the debug stream
170 
171  std::map<int, std::set<int> > rosBxIdsPerFED;
172  std::set<int> fedBXIds;
173  std::map<int, std::set<int> > rosL1AIdsPerFED;
174 
175  // flag to toggle the creation of only the summaries (for HLT running)
176  int mode;
178 
179  // The label to retrieve the digis
181 
183 
185 
186 
187 };
188 
189 
190 #endif
191 
192 
193 /* Local Variables: */
194 /* show-trailing-whitespace: t */
195 /* truncate-lines: t */
196 /* 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:82
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)