CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes

ecaldqm::PresampleClient Class Reference

#include <PresampleClient.h>

Inheritance diagram for ecaldqm::PresampleClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

List of all members.

Public Types

enum  MESets {
  kQuality, kMean, kMeanDCC, kRMS,
  kRMSMap, kRMSMapSummary, kQualitySummary, nMESets
}
enum  Sources { sPedestal, nSources }

Public Member Functions

void bookMEs ()
 PresampleClient (const edm::ParameterSet &, const edm::ParameterSet &)
void producePlots ()
 ~PresampleClient ()

Static Public Member Functions

static void setMEData (std::vector< MEData > &)

Protected Attributes

float expectedMean_
float meanThreshold_
int minChannelEntries_
int minTowerEntries_
float noisyFracThreshold_
float rmsThreshold_
float rmsThresholdHighEta_

Detailed Description

Definition at line 8 of file PresampleClient.h.


Member Enumeration Documentation

Enumerator:
kQuality 
kMean 
kMeanDCC 
kRMS 
kRMSMap 
kRMSMapSummary 
kQualitySummary 
nMESets 

Reimplemented from ecaldqm::DQWorker.

Definition at line 17 of file PresampleClient.h.

Enumerator:
sPedestal 
nSources 

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 30 of file PresampleClient.h.


Constructor & Destructor Documentation

data refman pasoursint CMSSW_5_3_10_patch1 src DQM EcalBarrelMonitorClient src PresampleClient cc ecaldqm::PresampleClient::PresampleClient ( const edm::ParameterSet _params,
const edm::ParameterSet _paths 
)

Definition at line 12 of file PresampleClient.cc.

References edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), and ecaldqm::PresampleTask::kPedestal.

  {
    edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
    minChannelEntries_ = taskParams.getUntrackedParameter<int>("minChannelEntries");
    minTowerEntries_ = taskParams.getUntrackedParameter<int>("minTowerEntries");
    expectedMean_ = taskParams.getUntrackedParameter<double>("expectedMean");
    meanThreshold_ = taskParams.getUntrackedParameter<double>("meanThreshold");
    rmsThreshold_ = taskParams.getUntrackedParameter<double>("rmsThreshold");
    rmsThresholdHighEta_ = taskParams.getUntrackedParameter<double>("rmsThresholdHighEta");
    noisyFracThreshold_ = taskParams.getUntrackedParameter<double>("noisyFracThreshold");

    edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
    source_(sPedestal, "PresampleTask", PresampleTask::kPedestal, sources);
  }

ecaldqm::PresampleClient::~PresampleClient ( ) [inline]

Definition at line 11 of file PresampleClient.h.

{}

Member Function Documentation

void ecaldqm::PresampleClient::bookMEs ( ) [virtual]

Reimplemented from ecaldqm::DQWorker.

Definition at line 36 of file PresampleClient.cc.

References kQuality, kQualitySummary, kRMSMap, kRMSMapSummary, and ecaldqm::DQWorker::MEs_.

  {
    DQWorker::bookMEs();

    MEs_[kQuality]->resetAll(-1.);
    MEs_[kRMSMap]->resetAll(-1.);
    MEs_[kRMSMapSummary]->resetAll(-1.);
    MEs_[kQualitySummary]->resetAll(-1.);
  }

void ecaldqm::PresampleClient::producePlots ( ) [virtual]

Implements ecaldqm::DQWorkerClient.

Definition at line 47 of file PresampleClient.cc.

References abs, python::tagInventory::entries, expectedMean_, ecaldqm::DQWorkerClient::fillQuality_(), ecaldqm::getElectronicsMap(), ecaldqm::getNSuperCrystals(), ecaldqm::kEEpLow, kMean, kMeanDCC, kQuality, kQualitySummary, kRMS, kRMSMap, kRMSMapSummary, timingPdfMaker::mean, meanThreshold_, ecaldqm::DQWorker::MEs_, minChannelEntries_, minTowerEntries_, noisyFracThreshold_, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR, plotscripts::rms(), rmsThreshold_, rmsThresholdHighEta_, ecaldqm::DQWorkerClient::sources_, sPedestal, and mathSSE::sqrt().

  {
    MEs_[kMean]->reset();
    MEs_[kMeanDCC]->reset();
    MEs_[kRMS]->reset();
    MEs_[kRMSMap]->reset(-1.);
    MEs_[kRMSMapSummary]->reset(-1.);

    uint32_t mask(1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR |
                  1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR);

    for(unsigned dccid(1); dccid <= 54; dccid++){

      for(unsigned tower(1); tower <= getNSuperCrystals(dccid); tower++){
        std::vector<DetId> ids(getElectronicsMap()->dccTowerConstituents(dccid, tower));

        if(ids.size() == 0) continue;

        unsigned iSM(dccid - 1);
        float rmsThresh(rmsThreshold_);
        if(iSM <= kEEmHigh || iSM >= kEEpLow || tower > 48) rmsThresh = rmsThresholdHighEta_;

        float nNoisy(0.);
        float towerEntries(0.);
        float towerMean(0.);
        float towerRMS(0.);

        for(std::vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
          float entries(sources_[sPedestal]->getBinEntries(*idItr));
          float mean(sources_[sPedestal]->getBinContent(*idItr));
          float rms(sources_[sPedestal]->getBinError(*idItr) * std::sqrt(entries));
          towerEntries += entries;
          towerMean += mean * entries;
          towerRMS += (rms * rms + mean * mean) * entries;

          if(entries < minChannelEntries_){
            fillQuality_(kQuality, *idItr, mask, 2.);
            continue;
          }

          MEs_[kMean]->fill(*idItr, mean);
          MEs_[kMeanDCC]->fill(*idItr, mean);
          MEs_[kRMS]->fill(*idItr, rms);
          MEs_[kRMSMap]->fill(*idItr, rms);

          if(std::abs(mean - expectedMean_) > meanThreshold_ || rms > rmsThresh){
            fillQuality_(kQuality, *idItr, mask, 0.);
            nNoisy += 1.;
          }
          else
            fillQuality_(kQuality, *idItr, mask, 1.);
        }

        towerMean /= towerEntries;
        towerRMS = std::sqrt(towerRMS / towerEntries - towerMean * towerMean);

        float quality(-1.);

        if(towerEntries > minTowerEntries_)
          quality = nNoisy / ids.size() > noisyFracThreshold_ ? 0. : 1.;
        else
          quality = 2.;

        if(dccid <= 9 || dccid >= 46){
          std::vector<EcalScDetId> scs(getElectronicsMap()->getEcalScDetId(dccid, tower));
          for(std::vector<EcalScDetId>::iterator scItr(scs.begin()); scItr != scs.end(); ++scItr){
            fillQuality_(kQualitySummary, *scItr, mask, quality);
            MEs_[kRMSMapSummary]->setBinContent(*scItr, towerRMS);
          }
        }
        else{
          fillQuality_(kQualitySummary, ids[0], mask, quality);
          MEs_[kRMSMapSummary]->setBinContent(ids[0], towerRMS);
        }
      }
    }
  }

void ecaldqm::PresampleClient::setMEData ( std::vector< MEData > &  _data) [static]

Reimplemented from ecaldqm::DQWorker.

Definition at line 127 of file PresampleClient.cc.

References MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE, EcalDQMBinningService::AxisSpecs::high, EcalDQMBinningService::kCrystal, EcalDQMBinningService::kDCC, EcalDQMBinningService::kEcal2P, kMean, kMeanDCC, kQuality, kQualitySummary, kRMS, kRMSMap, kRMSMapSummary, EcalDQMBinningService::kSM, EcalDQMBinningService::kSuperCrystal, EcalDQMBinningService::kUser, EcalDQMBinningService::AxisSpecs::low, and EcalDQMBinningService::AxisSpecs::nbins.

  {
    BinService::AxisSpecs axis;

    _data[kQuality] = MEData("Quality", BinService::kSM, BinService::kCrystal, MonitorElement::DQM_KIND_TH2F);

    axis.nbins = 120;
    axis.low = 170.;
    axis.high = 230.;
    _data[kMean] = MEData("Mean", BinService::kSM, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
    _data[kMeanDCC] = MEData("MeanDCC", BinService::kEcal2P, BinService::kDCC, MonitorElement::DQM_KIND_TPROFILE, 0, &axis);

    axis.nbins = 100;
    axis.low = 0.;
    axis.high = 10.;
    _data[kRMS] = MEData("RMS", BinService::kSM, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
    _data[kRMSMap] = MEData("RMSMap", BinService::kSM, BinService::kCrystal, MonitorElement::DQM_KIND_TH2F, 0, 0, &axis);
    _data[kRMSMapSummary] = MEData("RMSMap", BinService::kEcal2P, BinService::kSuperCrystal, MonitorElement::DQM_KIND_TH2F, 0, 0, &axis);

    _data[kQualitySummary] = MEData("QualitySummary", BinService::kEcal2P, BinService::kSuperCrystal, MonitorElement::DQM_KIND_TH2F);
  }


Member Data Documentation

Definition at line 38 of file PresampleClient.h.

Referenced by producePlots().

Definition at line 39 of file PresampleClient.h.

Referenced by producePlots().

Definition at line 36 of file PresampleClient.h.

Referenced by producePlots().

Definition at line 37 of file PresampleClient.h.

Referenced by producePlots().

Definition at line 42 of file PresampleClient.h.

Referenced by producePlots().

Definition at line 40 of file PresampleClient.h.

Referenced by producePlots().

Definition at line 41 of file PresampleClient.h.

Referenced by producePlots().