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 
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 
84  void channelsInCEROS(int cerosId, int chMask, std::vector<int>& channels);
85  void channelsInROS(int cerosMask, std::vector<int>& channels);
86 
87  std::string topFolder(bool isFEDIntegrity) const;
88 
89  std::multimap<std::string, std::string> names;
90  std::multimap<std::string, std::string>::iterator it;
91 
93 
94  //If you want info VS time histos
96  // Plot quantities about SC
97  bool getSCInfo;
98  // Check FEDs from uROS, otherwise standard ROS
99  bool checkUros;
100 
101  int nevents;
102 
104 
105  // Monitor Elements
107  // <histoType, <index , histo> >
108  std::map<std::string, std::map<int, MonitorElement*> > fedHistos;
109  // <histoType, histo> >
110  std::map<std::string, std::map<int, MonitorElement*> > summaryHistos;
111  // <histoType, <index , histo> >
112  std::map<std::string, std::map<int, MonitorElement*> > rosHistos;
113  // <key , histo> >
114  std::map<unsigned int, MonitorElement*> urosHistos;
115  // <histoType, <tdcID, histo> >
116  std::map<std::string, std::map<int, MonitorElement*> > robHistos;
117 
118  //enum histoTypes for reduced map of MEs urosHistos
119  // key = stringEnum*1000 + (fed-minFED)#*100 + (uROS-minuROS)#
121 
122  // standard ME for monitoring of FED integrity
127 
128  // one for all FEDS
130 
131  //time histos for DDU/ROS
132  std::map<std::string, std::map<int, DTTimeEvolutionHisto*> > fedTimeHistos;
133  std::map<std::string, std::map<int, DTTimeEvolutionHisto*> > rosTimeHistos;
134  // <key, histo> >
135  std::map<unsigned int, DTTimeEvolutionHisto*> urosTimeHistos;
136  //key = (fed-minFED)#*100 + (uROS-minuROS)#
137 
139 
142 
145  double rob_max[25];
146  double link_max[72];
147 
148  int FEDIDmin;
149  int FEDIDmax;
150 
151  // Number of ROS/uROS per FED
152  const int NuROS = 12;
153 
154  //Event counter for the graphs VS time
155  int myPrevEv;
156 
157  //Monitor TTS,ROS,FIFO VS time
161 
162  // event error flag: true when errors are detected
163  // can be used for the selection of the debug stream
165 
166  std::map<int, std::set<int> > rosBxIdsPerFED;
167  std::set<int> fedBXIds;
168  std::map<int, std::set<int> > rosL1AIdsPerFED;
169 
170  // flag to toggle the creation of only the summaries (for HLT running)
171  int mode;
173 
174  // The label to retrieve the digis
176 
178 
180 
181 
182 };
183 
184 
185 #endif
186 
187 
188 /* Local Variables: */
189 /* show-trailing-whitespace: t */
190 /* truncate-lines: t */
191 /* End: */
std::map< int, std::set< int > > rosBxIdsPerFED
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
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:348
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:43