CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

EBPedestalOnlineClient Class Reference

#include <EBPedestalOnlineClient.h>

Inheritance diagram for EBPedestalOnlineClient:
EBClient

List of all members.

Public Member Functions

void analyze (void)
 Analyze.
void beginJob (void)
 BeginJob.
void beginRun (void)
 BeginRun.
void cleanup (void)
 Cleanup.
 EBPedestalOnlineClient (const edm::ParameterSet &ps)
 Constructor.
void endJob (void)
 EndJob.
void endRun (void)
 EndRun.
int getEvtPerJob ()
 Get Functions.
int getEvtPerRun ()
 Returns the number of processed events in this Run.
void setup (void)
 Setup.
virtual ~EBPedestalOnlineClient ()
 Destructor.

Private Attributes

bool cloneME_
bool debug_
float discrepancyMean_
DQMStoredqmStore_
bool enableCleanup_
float expectedMean_
TProfile2D * h03_ [36]
int ievt_
int jevt_
MonitorElementmeg03_ [36]
MonitorElementmep03_ [36]
MonitorElementmer03_ [36]
std::string prefixME_
float RMSThreshold_
float RMSThresholdHighEta_
std::string subfolder_
std::vector< int > superModules_
bool verbose_

Friends

class EBSummaryClient

Detailed Description

Definition at line 33 of file EBPedestalOnlineClient.h.


Constructor & Destructor Documentation

EBPedestalOnlineClient::EBPedestalOnlineClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 37 of file EBPedestalOnlineClient.cc.

References cloneME_, debug_, discrepancyMean_, enableCleanup_, expectedMean_, edm::ParameterSet::getUntrackedParameter(), h03_, i, ecalpyutils::ism(), meg03_, mep03_, mer03_, prefixME_, RMSThreshold_, RMSThresholdHighEta_, subfolder_, superModules_, and verbose_.

                                                                        {

  // cloneME switch
  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);

  // verbose switch
  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);

  // debug switch
  debug_ = ps.getUntrackedParameter<bool>("debug", false);

  // prefixME path
  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");

  subfolder_ = ps.getUntrackedParameter<std::string>("subfolder", "");

  // enableCleanup_ switch
  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);

  // vector of selected Super Modules (Defaults to all 36).
  superModules_.reserve(36);
  for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);

  for ( unsigned int i=0; i<superModules_.size(); i++ ) {

    int ism = superModules_[i];

    h03_[ism-1] = 0;

  }

  for ( unsigned int i=0; i<superModules_.size(); i++ ) {

    int ism = superModules_[i];

    meg03_[ism-1] = 0;

    mep03_[ism-1] = 0;

    mer03_[ism-1] = 0;

  }

  expectedMean_ = 200.0;
  discrepancyMean_ = 25.0;
  RMSThreshold_ = 3.0;
  RMSThresholdHighEta_ = 6.0;

}
EBPedestalOnlineClient::~EBPedestalOnlineClient ( ) [virtual]

Destructor.

Definition at line 88 of file EBPedestalOnlineClient.cc.

                                                {

}

Member Function Documentation

void EBPedestalOnlineClient::analyze ( void  ) [virtual]

Analyze.

Implements EBClient.

Definition at line 302 of file EBPedestalOnlineClient.cc.

References abs, cloneME_, gather_cfg::cout, debug_, discrepancyMean_, dqmStore_, EcalBarrel, expectedMean_, MonitorElement::Fill(), DQMStore::get(), UtilsClient::getBinStatistics(), h03_, i, ievt_, jevt_, UtilsClient::maskBinContent(), Masks::maskChannel(), meg03_, mep03_, mer03_, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR, prefixME_, MonitorElement::Reset(), RMSThreshold_, RMSThresholdHighEta_, Numbers::sEB(), MonitorElement::setBinContent(), subfolder_, and superModules_.

                                         {

  ievt_++;
  jevt_++;
  if ( ievt_ % 10 == 0 ) {
    if ( debug_ ) std::cout << "EBPedestalOnlineClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
  }

  uint32_t bits03 = 0;
  bits03 |= 1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR;
  bits03 |= 1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR;

  std::string subdir(subfolder_.size() ? subfolder_ + "/" : "");

  MonitorElement* me;

  for ( unsigned int i=0; i<superModules_.size(); i++ ) {

    int ism = superModules_[i];

    me = dqmStore_->get( prefixME_ + "/EBPedestalOnlineTask/" + subdir + "Gain12/EBPOT pedestal " + Numbers::sEB(ism) + " G12" );
    h03_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h03_[ism-1] );
    if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
    if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
    if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();

    for ( int ie = 1; ie <= 85; ie++ ) {
      for ( int ip = 1; ip <= 20; ip++ ) {

        if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ie, ip, 2.);

        bool update03;

        float num03;
        float mean03;
        float rms03;

        update03 = UtilsClient::getBinStatistics(h03_[ism-1], ie, ip, num03, mean03, rms03);

        if ( update03 ) {

          float val;

          val = 1.;
          if ( std::abs(mean03 - expectedMean_) > discrepancyMean_ )
            val = 0.;
          if ( (ie<=40 && rms03 > RMSThreshold_) || (ie>40 && rms03 > RMSThresholdHighEta_) )
            val = 0.;
          if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ie, ip, val);

          if ( mep03_[ism-1] ) mep03_[ism-1]->Fill(mean03);
          if ( mer03_[ism-1] ) mer03_[ism-1]->Fill(rms03);

        }

        if ( Masks::maskChannel(ism, ie, ip, bits03, EcalBarrel) ) UtilsClient::maskBinContent( meg03_[ism-1], ie, ip );

      }
    }

  }

}
void EBPedestalOnlineClient::beginJob ( void  ) [virtual]

BeginJob.

Implements EBClient.

Definition at line 92 of file EBPedestalOnlineClient.cc.

References gather_cfg::cout, debug_, dqmStore_, ievt_, jevt_, and cppFunctionSkipper::operator.

                                          {

  dqmStore_ = edm::Service<DQMStore>().operator->();

  if ( debug_ ) std::cout << "EBPedestalOnlineClient: beginJob" << std::endl;

  ievt_ = 0;
  jevt_ = 0;

}
void EBPedestalOnlineClient::beginRun ( void  ) [virtual]

BeginRun.

Implements EBClient.

Definition at line 103 of file EBPedestalOnlineClient.cc.

References gather_cfg::cout, debug_, jevt_, and setup().

                                          {

  if ( debug_ ) std::cout << "EBPedestalOnlineClient: beginRun" << std::endl;

  jevt_ = 0;

  this->setup();

}
void EBPedestalOnlineClient::cleanup ( void  ) [virtual]

Cleanup.

Implements EBClient.

Definition at line 181 of file EBPedestalOnlineClient.cc.

References cloneME_, dqmStore_, enableCleanup_, edm::getName(), h03_, i, ecalpyutils::ism(), meg03_, mep03_, mer03_, prefixME_, DQMStore::removeElement(), DQMStore::setCurrentFolder(), subfolder_, and superModules_.

Referenced by endJob(), and endRun().

                                         {

  if ( ! enableCleanup_ ) return;

  for ( unsigned int i=0; i<superModules_.size(); i++ ) {

    int ism = superModules_[i];

    if ( cloneME_ ) {
      if ( h03_[ism-1] ) delete h03_[ism-1];
    }

    h03_[ism-1] = 0;

  }

  dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalOnlineClient" );

  if(subfolder_.size())
    dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalOnlineClient/" + subfolder_);

  for ( unsigned int i=0; i<superModules_.size(); i++ ) {

    int ism = superModules_[i];

    if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
    meg03_[ism-1] = 0;

    if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
    mep03_[ism-1] = 0;

    if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
    mer03_[ism-1] = 0;

  }

}
void EBPedestalOnlineClient::endJob ( void  ) [virtual]

EndJob.

Implements EBClient.

Definition at line 113 of file EBPedestalOnlineClient.cc.

References cleanup(), gather_cfg::cout, debug_, and ievt_.

                                        {

  if ( debug_ ) std::cout << "EBPedestalOnlineClient: endJob, ievt = " << ievt_ << std::endl;

  this->cleanup();

}
void EBPedestalOnlineClient::endRun ( void  ) [virtual]

EndRun.

Implements EBClient.

Definition at line 121 of file EBPedestalOnlineClient.cc.

References cleanup(), gather_cfg::cout, debug_, and jevt_.

                                        {

  if ( debug_ ) std::cout << "EBPedestalOnlineClient: endRun, jevt = " << jevt_ << std::endl;

  this->cleanup();

}
int EBPedestalOnlineClient::getEvtPerJob ( void  ) [inline, virtual]

Get Functions.

Implements EBClient.

Definition at line 72 of file EBPedestalOnlineClient.h.

References ievt_.

{ return ievt_; }
int EBPedestalOnlineClient::getEvtPerRun ( void  ) [inline, virtual]

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 73 of file EBPedestalOnlineClient.h.

References jevt_.

{ return jevt_; }
void EBPedestalOnlineClient::setup ( void  ) [virtual]

Setup.

Implements EBClient.

Definition at line 129 of file EBPedestalOnlineClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), dqmStore_, edm::getName(), i, ecalpyutils::ism(), meg03_, mep03_, mer03_, mergeVDriftHistosByStation::name, prefixME_, DQMStore::removeElement(), MonitorElement::Reset(), Numbers::sEB(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), subfolder_, and superModules_.

Referenced by beginRun().

                                       {

  std::string name;

  dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalOnlineClient" );

  if(subfolder_.size())
    dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalOnlineClient/" + subfolder_);

  for ( unsigned int i=0; i<superModules_.size(); i++ ) {

    int ism = superModules_[i];

    if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
    name = "EBPOT pedestal quality G12 " + Numbers::sEB(ism);
    meg03_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
    meg03_[ism-1]->setAxisTitle("ieta", 1);
    meg03_[ism-1]->setAxisTitle("iphi", 2);

    if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
    name = "EBPOT pedestal mean G12 " + Numbers::sEB(ism);
    mep03_[ism-1] = dqmStore_->book1D(name, name, 100, 150., 250.);
    mep03_[ism-1]->setAxisTitle("mean", 1);

    if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
    name = "EBPOT pedestal rms G12 " + Numbers::sEB(ism);
    mer03_[ism-1] = dqmStore_->book1D(name, name, 100, 0.,  10.);
    mer03_[ism-1]->setAxisTitle("rms", 1);

  }

  for ( unsigned int i=0; i<superModules_.size(); i++ ) {

    int ism = superModules_[i];

    if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();

    for ( int ie = 1; ie <= 85; ie++ ) {
      for ( int ip = 1; ip <= 20; ip++ ) {

        meg03_[ism-1]->setBinContent( ie, ip, 2. );

      }
    }

    if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
    if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();

  }

}

Friends And Related Function Documentation

friend class EBSummaryClient [friend]

Definition at line 35 of file EBPedestalOnlineClient.h.


Member Data Documentation

Definition at line 80 of file EBPedestalOnlineClient.h.

Referenced by analyze(), cleanup(), and EBPedestalOnlineClient().

Definition at line 106 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

Definition at line 93 of file EBPedestalOnlineClient.h.

Referenced by analyze(), beginJob(), cleanup(), and setup().

Definition at line 89 of file EBPedestalOnlineClient.h.

Referenced by cleanup(), and EBPedestalOnlineClient().

Definition at line 105 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

TProfile2D* EBPedestalOnlineClient::h03_[36] [private]

Definition at line 95 of file EBPedestalOnlineClient.h.

Referenced by analyze(), cleanup(), and EBPedestalOnlineClient().

Definition at line 77 of file EBPedestalOnlineClient.h.

Referenced by analyze(), beginJob(), endJob(), and getEvtPerJob().

Definition at line 78 of file EBPedestalOnlineClient.h.

Referenced by analyze(), beginJob(), beginRun(), endRun(), and getEvtPerRun().

Definition at line 99 of file EBPedestalOnlineClient.h.

Referenced by analyze(), cleanup(), EBPedestalOnlineClient(), and setup().

Definition at line 101 of file EBPedestalOnlineClient.h.

Referenced by analyze(), cleanup(), EBPedestalOnlineClient(), and setup().

std::string EBPedestalOnlineClient::prefixME_ [private]

Definition at line 85 of file EBPedestalOnlineClient.h.

Referenced by analyze(), cleanup(), EBPedestalOnlineClient(), and setup().

Definition at line 107 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

Definition at line 107 of file EBPedestalOnlineClient.h.

Referenced by analyze(), and EBPedestalOnlineClient().

std::string EBPedestalOnlineClient::subfolder_ [private]

Definition at line 87 of file EBPedestalOnlineClient.h.

Referenced by analyze(), cleanup(), EBPedestalOnlineClient(), and setup().

std::vector<int> EBPedestalOnlineClient::superModules_ [private]

Definition at line 91 of file EBPedestalOnlineClient.h.

Referenced by analyze(), cleanup(), EBPedestalOnlineClient(), and setup().

Definition at line 82 of file EBPedestalOnlineClient.h.

Referenced by EBPedestalOnlineClient().