CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Private Attributes

ecaldqm::OccupancyClient Class Reference

#include <OccupancyClient.h>

Inheritance diagram for ecaldqm::OccupancyClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

List of all members.

Public Types

enum  MESets {
  kHotDigi, kHotRecHitThr, kHotTPDigiThr, kQualitySummary,
  nMESets
}
enum  Sources { sDigi, sRecHitThr, sTPDigiThr, nSources }

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &)
void bookMEs ()
 OccupancyClient (const edm::ParameterSet &, const edm::ParameterSet &)
void producePlots ()
 ~OccupancyClient ()

Static Public Member Functions

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

Private Attributes

float deviationThreshold_
const CaloGeometrygeometry_
int minHits_

Detailed Description

Definition at line 10 of file OccupancyClient.h.


Member Enumeration Documentation

Enumerator:
kHotDigi 
kHotRecHitThr 
kHotTPDigiThr 
kQualitySummary 
nMESets 

Reimplemented from ecaldqm::DQWorker.

Definition at line 21 of file OccupancyClient.h.

Enumerator:
sDigi 
sRecHitThr 
sTPDigiThr 
nSources 

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 31 of file OccupancyClient.h.


Constructor & Destructor Documentation

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

Definition at line 16 of file OccupancyClient.cc.

References edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::OccupancyTask::kDigi, ecaldqm::OccupancyTask::kRecHitThr, and ecaldqm::OccupancyTask::kTPDigiThr.

  {
    edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
    minHits_ = taskParams.getUntrackedParameter<int>("minHits");
    deviationThreshold_ = taskParams.getUntrackedParameter<double>("deviationThreshold");

    edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
    source_(sDigi, "OccupancyTask", OccupancyTask::kDigi, sources);
    source_(sRecHitThr, "OccupancyTask", OccupancyTask::kRecHitThr, sources);
    source_(sTPDigiThr, "OccupancyTask", OccupancyTask::kTPDigiThr, sources);
  }

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

Definition at line 13 of file OccupancyClient.h.

{}

Member Function Documentation

void ecaldqm::OccupancyClient::beginRun ( const edm::Run ,
const edm::EventSetup _es 
) [virtual]

Reimplemented from ecaldqm::DQWorker.

Definition at line 33 of file OccupancyClient.cc.

References Exception, geometry_, edm::EventSetup::get(), and edm::ESHandle< T >::product().

  {
    edm::ESHandle<CaloGeometry> geomHndl;
    _es.get<CaloGeometryRecord>().get(geomHndl);
    geometry_ = geomHndl.product();
    if(!geometry_)
      throw cms::Exception("EventSetup") << "CaloGeometry invalid";
  }

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 43 of file OccupancyClient.cc.

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

  {
    DQWorker::bookMEs();

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

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

Implements ecaldqm::DQWorkerClient.

Definition at line 51 of file OccupancyClient.cc.

References EcalTrigTowerDetId::detIdFromDenseIndex(), deviationThreshold_, python::tagInventory::entries, ecaldqm::DQWorkerClient::fillQuality_(), ecaldqm::getElectronicsMap(), ecaldqm::getNSuperCrystals(), ecaldqm::getTrigTowerMap(), EcalTrigTowerDetId::ietaAbs(), kHotDigi, kHotRecHitThr, kHotTPDigiThr, kQualitySummary, EcalTrigTowerDetId::kSizeForDenseIndexing, ecaldqm::DQWorker::MEs_, minHits_, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR, sDigi, ecaldqm::DQWorkerClient::sources_, sRecHitThr, and sTPDigiThr.

  {
    using namespace std;

    MEs_[kHotDigi]->reset();
    MEs_[kHotRecHitThr]->reset();
    MEs_[kHotTPDigiThr]->reset();

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

    vector<double> digiPhiRingMean(28, 0.);
    vector<double> rechitPhiRingMean(28, 0.);
    vector<int> numCrystals(28, 0); // this is static, but is easier to count now

    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;

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

          int ieta(getTrigTowerMap()->towerOf(*idItr).ietaAbs());
          digiPhiRingMean.at(ieta - 1) += entries;
          rechitPhiRingMean.at(ieta - 1) += rhentries;

          numCrystals.at(ieta - 1) += 1;
        }
      }
    }

    for(int ie(0); ie < 28; ie++){
      digiPhiRingMean[ie] /= numCrystals[ie];
      rechitPhiRingMean[ie] /= numCrystals[ie];
    }

    // second round to find hot towers
    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;

        float quality(1.);
        for(vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
          float entries(sources_[sDigi]->getBinContent(*idItr));
          float rhentries(sources_[sRecHitThr]->getBinContent(*idItr));

          int ieta(getTrigTowerMap()->towerOf(*idItr).ietaAbs());

          if(entries > minHits_ && entries > digiPhiRingMean.at(ieta - 1) * deviationThreshold_){
            MEs_[kHotDigi]->fill(*idItr);
            quality = 0.;
          }
          if(rhentries > minHits_ && rhentries > rechitPhiRingMean.at(ieta - 1) * deviationThreshold_){
            MEs_[kHotRecHitThr]->fill(*idItr);
            quality = 0.;
          }
        }
        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);
      }
    }

    vector<double> tpdigiPhiRingMean(28, 0.);

    for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++){
      EcalTrigTowerDetId ttid(EcalTrigTowerDetId::detIdFromDenseIndex(iTT));
      float entries(sources_[sTPDigiThr]->getBinContent(ttid));

      tpdigiPhiRingMean.at(ttid.ietaAbs() - 1) += entries;
    }

    for(int ie(0); ie < 28; ie++){
      float denom(-1.);
      if(ie < 27) denom = 72.;
      else denom = 36.;
      tpdigiPhiRingMean[ie] /= denom;
    }

    for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++){
      EcalTrigTowerDetId ttid(EcalTrigTowerDetId::detIdFromDenseIndex(iTT));
      float entries(sources_[sTPDigiThr]->getBinContent(ttid));

      if(entries > minHits_ && entries > tpdigiPhiRingMean.at(ttid.ietaAbs() - 1) * deviationThreshold_){
        MEs_[kHotTPDigiThr]->fill(ttid);
        vector<DetId> ids(getTrigTowerMap()->constituentsOf(ttid));
        for(vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
          if(MEs_[kQualitySummary]->getBinContent(*idItr) > 0.)
            fillQuality_(kQualitySummary, *idItr, mask, 0.);
        }
      }   
    }

  }

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

Member Data Documentation

Definition at line 42 of file OccupancyClient.h.

Referenced by producePlots().

Definition at line 39 of file OccupancyClient.h.

Referenced by beginRun().

Definition at line 41 of file OccupancyClient.h.

Referenced by producePlots().