CMS 3D CMS Logo

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

ecaldqm::TimingClient Class Reference

#include <TimingClient.h>

Inheritance diagram for ecaldqm::TimingClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

List of all members.

Public Types

enum  MESets {
  kQuality, kMeanSM, kMeanAll, kFwdBkwdDiff,
  kFwdvBkwd, kRMS, kRMSAll, kProjEta,
  kProjPhi, kQualitySummary, nMESets
}
enum  Sources { sTimeAllMap, sTimeMap, nSources }

Public Member Functions

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

Static Public Member Functions

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

Protected Attributes

float expectedMean_
float meanThreshold_
int minChannelEntries_
int minTowerEntries_
float rmsThreshold_
float tailPopulThreshold_

Detailed Description

Definition at line 8 of file TimingClient.h.


Member Enumeration Documentation

Enumerator:
kQuality 
kMeanSM 
kMeanAll 
kFwdBkwdDiff 
kFwdvBkwd 
kRMS 
kRMSAll 
kProjEta 
kProjPhi 
kQualitySummary 
nMESets 

Reimplemented from ecaldqm::DQWorker.

Definition at line 17 of file TimingClient.h.

Enumerator:
sTimeAllMap 
sTimeMap 
nSources 

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 33 of file TimingClient.h.


Constructor & Destructor Documentation

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

Definition at line 12 of file TimingClient.cc.

References edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::TimingTask::kTimeAllMap, and ecaldqm::TimingTask::kTimeMap.

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

    edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
    source_(sTimeAllMap, "TimingTask", TimingTask::kTimeAllMap, sources);
    source_(sTimeMap, "TimingTask", TimingTask::kTimeMap, sources);
  }

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

Definition at line 11 of file TimingClient.h.

{}

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 35 of file TimingClient.cc.

References kQuality, kQualitySummary, kRMS, and ecaldqm::DQWorker::MEs_.

  {
    DQWorker::bookMEs();

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

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

Implements ecaldqm::DQWorkerClient.

Definition at line 45 of file TimingClient.cc.

References abs, EcalEndcap, python::tagInventory::entries, expectedMean_, ecaldqm::DQWorkerClient::fillQuality_(), ecaldqm::getElectronicsMap(), ecaldqm::getNSuperCrystals(), kFwdBkwdDiff, kFwdvBkwd, kMeanAll, kMeanSM, kProjEta, kProjPhi, kQuality, kQualitySummary, kRMS, kRMSAll, timingPdfMaker::mean, meanThreshold_, ecaldqm::DQWorker::MEs_, minChannelEntries_, minTowerEntries_, EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING, plotscripts::rms(), rmsThreshold_, ecaldqm::DQWorkerClient::sources_, mathSSE::sqrt(), sTimeAllMap, sTimeMap, EEDetId::switchZSide(), EBDetId::switchZSide(), and tailPopulThreshold_.

  {
    using namespace std;

    MEs_[kMeanSM]->reset();
    MEs_[kMeanAll]->reset();
    MEs_[kRMS]->reset(-1.);
    MEs_[kRMSAll]->reset();
    MEs_[kProjEta]->reset();
    MEs_[kProjPhi]->reset();
    MEs_[kFwdBkwdDiff]->reset();
    MEs_[kFwdvBkwd]->reset();

    uint32_t mask(1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING);

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

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

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

        // tower entries != sum(channel entries) because of the difference in timing cut at the source
        float summaryEntries(0.);
        if(dccid <= 9 || dccid >= 46){
          vector<EcalScDetId> scids(getElectronicsMap()->getEcalScDetId(dccid, tower));
          for(vector<EcalScDetId>::iterator scItr(scids.begin()); scItr != scids.end(); ++scItr)
            summaryEntries += sources_[sTimeAllMap]->getBinEntries(*scItr);
        }
        else
          summaryEntries = sources_[sTimeAllMap]->getBinEntries(ids[0]);

        float towerEntries(0.);
        float towerMean(0.);
        float towerMean2(0.);

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

          towerEntries += entries;
          towerMean += mean;
          towerMean2 += mean * mean;

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

          MEs_[kMeanSM]->fill(*idItr, mean);
          MEs_[kMeanAll]->fill(*idItr, mean);
          MEs_[kProjEta]->fill(*idItr, mean);
          MEs_[kProjPhi]->fill(*idItr, mean);
          MEs_[kRMS]->fill(*idItr, rms);
          MEs_[kRMSAll]->fill(*idItr, rms);

          if(dccid <= 27){
            DetId posId(0);
            if(idItr->subdetId() == EcalEndcap){
              posId = EEDetId::switchZSide(*idItr);
            }
            else{
              posId = EBDetId::switchZSide(*idItr);
            }
            float posTime(sources_[sTimeMap]->getBinContent(posId));
            MEs_[kFwdBkwdDiff]->fill(*idItr, posTime - mean);
            MEs_[kFwdvBkwd]->fill(*idItr, mean, posTime);
          }

          float quality(abs(mean - expectedMean_) > meanThreshold_ || rms > rmsThreshold_ ? 0. : 1.);
          fillQuality_(kQuality, *idItr, mask, quality);
        }

        float quality(1.);
        if(towerEntries > minTowerEntries_){
          if(summaryEntries < towerEntries * (1. - tailPopulThreshold_)) // large timing deviation
            quality = 0.;

          towerMean /= ids.size();
          towerMean2 /= ids.size();

          float towerRMS(0.);
          float variance(towerMean2 - towerMean * towerMean);
          if(variance > 0.) towerRMS = sqrt(variance);

          if(abs(towerMean - expectedMean_) > meanThreshold_ || towerRMS > rmsThreshold_)
            quality = 0.;
        }
        else
          quality = 2.;

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

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 150 of file TimingClient.cc.

References MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE, EcalDQMBinningService::AxisSpecs::high, EcalDQMBinningService::kCrystal, EcalDQMBinningService::kEcal2P, EcalDQMBinningService::kEcal3P, kFwdBkwdDiff, kFwdvBkwd, kMeanAll, kMeanSM, EcalDQMBinningService::kProjEta, kProjEta, EcalDQMBinningService::kProjPhi, kProjPhi, kQuality, kQualitySummary, kRMS, kRMSAll, EcalDQMBinningService::kSM, EcalDQMBinningService::kSuperCrystal, EcalDQMBinningService::kUser, EcalDQMBinningService::AxisSpecs::low, and EcalDQMBinningService::AxisSpecs::nbins.


Member Data Documentation

Definition at line 40 of file TimingClient.h.

Referenced by producePlots().

Definition at line 41 of file TimingClient.h.

Referenced by producePlots().

Definition at line 43 of file TimingClient.h.

Referenced by producePlots().

Definition at line 44 of file TimingClient.h.

Referenced by producePlots().

Definition at line 42 of file TimingClient.h.

Referenced by producePlots().

Definition at line 45 of file TimingClient.h.

Referenced by producePlots().