Go to the documentation of this file.00001 #include "../interface/RawDataClient.h"
00002
00003 #include "DQM/EcalBarrelMonitorTasks/interface/RawDataTask.h"
00004
00005 #include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h"
00006 #include "DQM/EcalCommon/interface/FEFlags.h"
00007
00008 #include <cmath>
00009
00010 namespace ecaldqm {
00011
00012 RawDataClient::RawDataClient(const edm::ParameterSet& _params, const edm::ParameterSet& _paths) :
00013 DQWorkerClient(_params, _paths, "RawDataClient"),
00014 synchErrorThreshold_(0)
00015 {
00016 edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
00017 synchErrorThreshold_ = taskParams.getUntrackedParameter<int>("synchErrorThreshold");
00018
00019 edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
00020 source_(sL1ADCC, "RawDataTask", RawDataTask::kL1ADCC, sources);
00021 source_(sFEStatus, "RawDataTask", RawDataTask::kFEStatus, sources);
00022 }
00023
00024 void
00025 RawDataClient::bookMEs()
00026 {
00027 DQWorker::bookMEs();
00028
00029 MEs_[kQualitySummary]->resetAll(-1.);
00030 }
00031
00032 void
00033 RawDataClient::producePlots()
00034 {
00035 uint32_t mask(1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR);
00036
00037 for(unsigned dccid(1); dccid <= 54; dccid++){
00038
00039 float l1aDesync(sources_[sL1ADCC]->getBinContent(dccid));
00040
00041 float dccStatus(l1aDesync > synchErrorThreshold_ ? 0. : 1.);
00042
00043 for(unsigned tower(1); tower <= getNSuperCrystals(dccid); tower++){
00044 std::vector<DetId> ids(getElectronicsMap()->dccTowerConstituents(dccid, tower));
00045
00046 if(ids.size() == 0) continue;
00047
00048 float towerStatus(dccStatus);
00049
00050 if(towerStatus > 0.){
00051 float towerEntries(0.);
00052 for(unsigned iS(0); iS < nFEFlags; iS++){
00053 float entries(sources_[sFEStatus]->getBinContent(ids[0], iS + 1));
00054 towerEntries += entries;
00055 if(entries > 0. &&
00056 iS != Enabled && iS != Disabled && iS != Suppressed &&
00057 iS != FIFOFull && iS != FIFOFullL1ADesync && iS != ForcedZS)
00058 towerStatus = 0.;
00059 }
00060
00061 if(towerEntries < 1.) towerStatus = 2.;
00062 }
00063
00064 if(dccid <= 9 || dccid >= 46){
00065 std::vector<EcalScDetId> scs(getElectronicsMap()->getEcalScDetId(dccid, tower));
00066 for(std::vector<EcalScDetId>::iterator scItr(scs.begin()); scItr != scs.end(); ++scItr)
00067 fillQuality_(kQualitySummary, *scItr, mask, towerStatus);
00068 }
00069 else
00070 fillQuality_(kQualitySummary, ids[0], mask, towerStatus);
00071 }
00072 }
00073 }
00074
00075
00076 void
00077 RawDataClient::setMEData(std::vector<MEData>& _data)
00078 {
00079 _data[kQualitySummary] = MEData("QualitySummary", BinService::kEcal2P, BinService::kSuperCrystal, MonitorElement::DQM_KIND_TH2F);
00080 }
00081
00082 DEFINE_ECALDQM_WORKER(RawDataClient);
00083 }
00084