CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DQM/HcalMonitorClient/interface/HcalRawDataClient.h

Go to the documentation of this file.
00001 #ifndef HcalRawDataClient_GUARD_H
00002 #define HcalRawDataClient_GUARD_H
00003 #define  NUMDCCS      32
00004 #define  NUMSPGS     15
00005 #define  HTRCHANMAX   24
00006 
00007 #include "DQM/HcalMonitorClient/interface/HcalBaseDQClient.h"
00008 #include "FWCore/Framework/interface/MakerMacros.h"
00009 #include "FWCore/ServiceRegistry/interface/Service.h"
00010 #include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h"
00011 
00012 class HcalRawDataClient : public HcalBaseDQClient {
00013 
00014  public:
00015 
00017   HcalRawDataClient(){name_="";};
00018   HcalRawDataClient(std::string myname);//{ name_=myname;};
00019   HcalRawDataClient(std::string myname, const edm::ParameterSet& ps);
00020 
00021   void analyze(void);
00022   void calculateProblems(void); // calculates problem histogram contents
00023   void updateChannelStatus(std::map<HcalDetId, unsigned int>& myqual);
00024   void beginJob(void);
00025   void endJob(void);
00026   void beginRun(void);
00027   void endRun(void); 
00028   void setup(void);  
00029   void cleanup(void);
00030   void endLuminosityBlock(void);
00031   bool hasErrors_Temp(void);  
00032   bool hasWarnings_Temp(void);
00033   bool hasOther_Temp(void);
00034   bool test_enabled(void);
00035   
00037   ~HcalRawDataClient();
00038 
00039  private:
00040   int nevts_;
00041   // Machinery here for transforming hardware space into ieta/iphi/depth
00042   const HcalElectronicsMap*    readoutMap_;
00043   //Electronics map -> geographic channel map
00044   inline int hashup(uint32_t d=0, uint32_t s=0, uint32_t c=1) {
00045     return (int) ( (d*NUMSPGS*HTRCHANMAX)+(s*HTRCHANMAX)+(c)); }
00046   void stashHDI(int thehash, HcalDetId thehcaldetid);
00047   //Protect against indexing past array.
00048   inline HcalDetId HashToHDI(int thehash) {
00049     return ( ( (thehash<0) || (thehash>(NUMDCCS*NUMSPGS*HTRCHANMAX)) )
00050              ?(HcalDetId::Undefined)
00051              :(hashedHcalDetId_[thehash]));
00052   };
00053   HcalDetId hashedHcalDetId_[NUMDCCS * NUMSPGS * HTRCHANMAX];
00054 
00055   float numTS_[NUMDCCS*NUMSPGS]; //For how many timesamples per channel were the half-HTRs configured?
00056   //Histograms indicating problems in hardware space
00057   TH2F*  meCDFErrorFound_;
00058   TH2F*  meDCCEventFormatError_;
00059   TH2F*  meOrNSynch_;
00060   TH2F*  meBCNSynch_;
00061   TH2F*  meEvtNumberSynch_;
00062   TH2F*  LRBDataCorruptionIndicators_;
00063   TH2F*  HalfHTRDataCorruptionIndicators_;
00064   TH2F*  DataFlowInd_;
00065   TH2F*  ChannSumm_DataIntegrityCheck_;    
00066   // handy array of pointers to pointers...
00067   TH2F* Chann_DataIntegrityCheck_[NUMDCCS];
00068 
00069   void getHardwareSpaceHistos(void);
00070 
00071   void fillProblemCountArray(void);
00072   uint64_t problemcount[85][72][4]; // HFd1,2 at 'depths' 3,4 to avoid collision with HE
00073   void mapDCCproblem  (int dcc, float n) ;                         // Take maximum problem counters for affected cells
00074   void mapHTRproblem  (int dcc, int spigot, float n) ;             // Take maximum problem counters for affected cells
00075   void mapChannproblem(int dcc, int spigot, int htrchan, float n); // Take maximum problem counters for affected cell.
00076 
00077   void normalizeHardwareSpaceHistos(void);
00078 };
00079 
00080 #endif