CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQM/DTMonitorModule/interface/DTDataIntegrityTask.h

Go to the documentation of this file.
00001 #ifndef DTDataIntegrityTask_H
00002 #define DTDataIntegrityTask_H
00003 
00015 #include "EventFilter/DTRawToDigi/interface/DTDataMonitorInterface.h"
00016 #include "EventFilter/DTRawToDigi/interface/DTROChainCoding.h"
00017 
00018 #include "FWCore/Framework/interface/Frameworkfwd.h"
00019 #include "FWCore/Framework/interface/Event.h"
00020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00021 #include <FWCore/Framework/interface/LuminosityBlock.h>
00022 
00023 #include "DQMServices/Core/interface/DQMStore.h"
00024 
00025 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
00026 #include "DQMServices/Core/interface/MonitorElement.h"
00027 
00028 #include <fstream>
00029 #include <map>
00030 #include <string>
00031 #include <vector>
00032 #include <list>
00033 
00034 class DTROS25Data;
00035 class DTDDUData;
00036 
00037 
00038 class DTDataIntegrityTask : public DTDataMonitorInterface {
00039 
00040 public:
00041 
00042   explicit DTDataIntegrityTask( const edm::ParameterSet& ps,edm::ActivityRegistry& reg);
00043   
00044   virtual ~DTDataIntegrityTask();
00045 
00046   void TimeHistos(std::string histoType);
00047 
00048   void processROS25(DTROS25Data & data, int dduID, int ros);
00049   void processFED(DTDDUData & dduData, const std::vector<DTROS25Data> & rosData, int dduID);
00050 
00051   // log number of times the payload of each fed is unpacked 
00052   void fedEntry(int dduID);
00053   // log number of times the payload of each fed is skipped (no ROS inside)
00054   void fedFatal(int dduID);
00055   // log number of times the payload of each fed is partially skipped (some ROS skipped)
00056   void fedNonFatal(int dduID);
00057 
00058   bool eventHasErrors() const;
00059   void postBeginJob();
00060   void postEndJob();
00061   void preProcessEvent(const edm::EventID& iEvtid, const edm::Timestamp& iTime);
00062 
00063 private:
00064 
00065   void bookHistos(const int fedMin, const int fedMax);
00066   void bookHistos(std::string folder, DTROChainCoding code);
00067   void bookHistosROS25(DTROChainCoding code);
00068 
00069   void channelsInCEROS(int cerosId, int chMask, std::vector<int>& channels);
00070   void channelsInROS(int cerosMask, std::vector<int>& channels);
00071 
00072   std::string topFolder(bool isFEDIntegrity) const;
00073 
00074   std::multimap<std::string, std::string> names;
00075   std::multimap<std::string, std::string>::iterator it;
00076 
00077   edm::ParameterSet parameters;
00078 
00079   //If you want info VS time histos
00080   bool doTimeHisto;
00081   // Plot quantities about SC
00082   bool getSCInfo;
00083 
00084   // back-end interface
00085   DQMStore * dbe;
00086   
00087   DTROChainCoding coding;
00088 
00089   // Monitor Elements
00090   // <histoType, <index , histo> >    
00091   std::map<std::string, std::map<int, MonitorElement*> > dduHistos;
00092   // <histoType, histo> >    
00093   std::map<std::string, std::map<int, MonitorElement*> > rosSHistos;
00094   // <histoType, <index , histo> >    
00095   std::map<std::string, std::map<int, MonitorElement*> > rosHistos;
00096   // <histoType, <tdcID, histo> >   
00097   std::map<std::string, std::map<int, MonitorElement*> > robHistos;
00098 
00099   // standard ME for monitoring of FED integrity
00100   MonitorElement* hFEDEntry;
00101   MonitorElement* hFEDFatal;
00102   MonitorElement* hFEDNonFatal;
00103   MonitorElement* hCorruptionSummary;
00104 
00105   // one for all FEDS
00106   MonitorElement* hTTSSummary;
00107 
00108   int neventsDDU;
00109   int neventsROS25;
00110   float trigger_counter;
00111   std::string outputFile;
00112   double rob_max[25];
00113   
00114   //Event counter for the graphs VS time
00115   int myPrevEv;
00116   
00117   //Monitor TTS,ROS,FIFO VS time
00118   int myPrevTtsVal;
00119   int myPrevRosVal;
00120   int myPrevFifoVal[7];
00121  
00122   // event error flag: true when errors are detected
00123   // can be used for the selection of the debug stream
00124   bool eventErrorFlag;
00125 
00126   std::map<int, std::set<int> > rosBxIdsPerFED;
00127   std::set<int> fedBXIds;
00128   std::map<int, std::set<int> > rosL1AIdsPerFED;
00129 
00130   // flag to toggle the creation of only the summaries (for HLT running)
00131   int mode;
00132   std::string fedIntegrityFolder; 
00133 
00134 };
00135 
00136 
00137 #endif
00138