CMS 3D CMS Logo

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

ecaldqm::IntegrityClient Class Reference

#include <IntegrityClient.h>

Inheritance diagram for ecaldqm::IntegrityClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

List of all members.

Public Types

enum  MESets { kQuality, kQualitySummary, nMESets }
enum  Sources {
  sOccupancy, sGain, sChId, sGainSwitch,
  sTowerId, sBlockSize, nSources
}

Public Member Functions

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

Static Public Member Functions

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

Protected Attributes

float errFractionThreshold_

Detailed Description

Definition at line 8 of file IntegrityClient.h.


Member Enumeration Documentation

Enumerator:
kQuality 
kQualitySummary 
nMESets 

Reimplemented from ecaldqm::DQWorker.

Definition at line 17 of file IntegrityClient.h.

Enumerator:
sOccupancy 
sGain 
sChId 
sGainSwitch 
sTowerId 
sBlockSize 
nSources 

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 25 of file IntegrityClient.h.


Constructor & Destructor Documentation

data refman pasoursint CMSSW_5_3_4 src DQM EcalBarrelMonitorClient src IntegrityClient cc ecaldqm::IntegrityClient::IntegrityClient ( const edm::ParameterSet _params,
const edm::ParameterSet _paths 
)
ecaldqm::IntegrityClient::~IntegrityClient ( ) [inline]

Definition at line 11 of file IntegrityClient.h.

{}

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 28 of file IntegrityClient.cc.

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

  {
    DQWorker::bookMEs();

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

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

Implements ecaldqm::DQWorkerClient.

Definition at line 37 of file IntegrityClient.cc.

References EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR, EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR, EcalDQMStatusHelper::CH_ID_ERROR, python::tagInventory::entries, errFractionThreshold_, ecaldqm::DQWorkerClient::fillQuality_(), ecaldqm::getElectronicsMap(), ecaldqm::getNSuperCrystals(), kQuality, kQualitySummary, sBlockSize, sChId, sGain, sGainSwitch, sOccupancy, ecaldqm::DQWorkerClient::sources_, sTowerId, EcalDQMStatusHelper::TT_ID_ERROR, and EcalDQMStatusHelper::TT_SIZE_ERROR.

  {
    uint32_t mask(1 << EcalDQMStatusHelper::CH_ID_ERROR |
                  1 << EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR |
                  1 << EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR |
                  1 << EcalDQMStatusHelper::TT_ID_ERROR |
                  1 << EcalDQMStatusHelper::TT_SIZE_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;

        float towerEntries(0.);
        bool towerGood(true);

        for(std::vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
          float entries(sources_[sOccupancy]->getBinContent(*idItr));
          towerEntries += entries;

          float gain(sources_[sGain]->getBinContent(*idItr));
          float chid(sources_[sChId]->getBinContent(*idItr));
          float gainswitch(sources_[sGainSwitch]->getBinContent(*idItr));

          if(entries + gain + chid + gainswitch < 1.){
            fillQuality_(kQuality, *idItr, mask, 2.);
            continue;
          }

          float chErr((gain + chid + gainswitch) / (entries + gain + chid + gainswitch));

          if(chErr > errFractionThreshold_){
            fillQuality_(kQuality, *idItr, mask, 0.);
            towerGood = false;
          }
          else
            fillQuality_(kQuality, *idItr, mask, 1.);
        }

        float towerid(sources_[sTowerId]->getBinContent(ids[0]));
        float blocksize(sources_[sBlockSize]->getBinContent(ids[0]));

        float quality(-1.);

        if(towerEntries + towerid + blocksize > 1.){
          float towerErr((towerid + blocksize) / (towerEntries + towerid + blocksize));
          if(towerErr > errFractionThreshold_) towerGood = false;

          quality = towerGood ? 1. : 0.;
        }
        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);
        }
        else
          fillQuality_(kQualitySummary, ids[0], mask, quality);
      }
    }
  }

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

Member Data Documentation

Definition at line 36 of file IntegrityClient.h.

Referenced by producePlots().