CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/DQM/EcalBarrelMonitorTasks/interface/SelectiveReadoutTask.h

Go to the documentation of this file.
00001 #ifndef SelectiveReadoutTask_H
00002 #define SelectiveReadoutTask_H
00003 
00004 #include "DQM/EcalCommon/interface/DQWorkerTask.h"
00005 
00006 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
00007 
00008 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
00009 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h"
00010 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00011 
00012 class EcalTrigTowerConstituentsMap;
00013 
00014 namespace ecaldqm {
00015 
00016   class SelectiveReadoutTask : public DQWorkerTask {
00017   public:
00018     SelectiveReadoutTask(const edm::ParameterSet &, const edm::ParameterSet &);
00019     ~SelectiveReadoutTask();
00020 
00021     void beginRun(const edm::Run &, const edm::EventSetup &);
00022     void beginEvent(const edm::Event &, const edm::EventSetup &);
00023 
00024     void analyze(const void*, Collections);
00025 
00026     void runOnSource(const FEDRawDataCollection &);
00027     void runOnRawData(const EcalRawDataCollection &);
00028     void runOnEBSrFlags(const EBSrFlagCollection &);
00029     void runOnEESrFlags(const EESrFlagCollection &);
00030     void runOnDigis(const EcalDigiCollection &, Collections);
00031 
00032     enum MESets {
00033       kTowerSize, // profile2d
00034       kDCCSize, // h2f
00035       kEventSize, // h1f
00036       kFlagCounterMap, // h2f counter
00037       kRUForcedMap, // h2f counter
00038       kFullReadout, // h1f
00039       kFullReadoutMap, // h2f counter
00040       kZS1Map, // h2f counter
00041       kZSMap, // h2f counter
00042       kZSFullReadout, // h1f
00043       kZSFullReadoutMap, // h2f counter
00044       kFRDropped, // h1f
00045       kFRDroppedMap, // h2f counter
00046       kHighIntPayload, // h1f
00047       kLowIntPayload, // h1f
00048       kHighIntOutput, // h1f
00049       kLowIntOutput, // h1f
00050       nMESets
00051     };
00052 
00053     static void setMEData(std::vector<MEData>&);
00054 
00055     enum Constants {
00056       nFIRTaps = 6,
00057       bytesPerCrystal = 24
00058     };
00059 
00060   private:
00061     void setFIRWeights_(const std::vector<double> &);
00062     void runOnSrFlag_(const DetId &, int, float&);
00063 
00064     bool useCondDb_;
00065     int iFirstSample_;
00066     std::vector<int> ZSFIRWeights_;
00067 
00068     const EcalChannelStatus *channelStatus_;
00069     const EcalTrigTowerConstituentsMap *ttMap_;
00070     const EBSrFlagCollection *ebSRFs_;
00071     const EESrFlagCollection *eeSRFs_;
00072 
00073     std::vector<short> feStatus_[54];
00074     std::set<uint32_t> frFlaggedTowers_;
00075     std::set<uint32_t> zsFlaggedTowers_;
00076     std::map<uint32_t, int> ttCrystals_;
00077 
00078   };
00079 
00080   inline void SelectiveReadoutTask::analyze(const void* _p, Collections _collection){
00081     switch(_collection){
00082     case kSource:
00083       runOnSource(*static_cast<const FEDRawDataCollection*>(_p));
00084       break;
00085     case kEcalRawData:
00086       runOnRawData(*static_cast<const EcalRawDataCollection*>(_p));
00087       break;
00088     case kEBSrFlag:
00089       runOnEBSrFlags(*static_cast<const EBSrFlagCollection*>(_p));
00090       break;
00091     case kEESrFlag:
00092       runOnEESrFlags(*static_cast<const EESrFlagCollection*>(_p));
00093       break;
00094     case kEBDigi:
00095     case kEEDigi:
00096       runOnDigis(*static_cast<const EcalDigiCollection*>(_p), _collection);
00097       break;
00098     default:
00099       break;
00100     }
00101   }
00102 
00103 }
00104 
00105 #endif
00106