CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

EETestPulseClient Class Reference

#include <EETestPulseClient.h>

Inheritance diagram for EETestPulseClient:
EEClient

List of all members.

Public Member Functions

void analyze (void)
 Analyze.
void beginJob (void)
 BeginJob.
void beginRun (void)
 BeginRun.
void cleanup (void)
 Cleanup.
 EETestPulseClient (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 ~EETestPulseClient ()
 Destructor.

Private Attributes

float amplitudeThreshold_
float amplitudeThresholdPnG01_
float amplitudeThresholdPnG16_
bool cloneME_
bool debug_
DQMStoredqmStore_
bool enableCleanup_
TProfile2D * ha01_ [18]
TProfile2D * ha02_ [18]
TProfile2D * ha03_ [18]
TProfile2D * hs01_ [18]
TProfile2D * hs02_ [18]
TProfile2D * hs03_ [18]
TProfile * i01_ [18]
TProfile * i02_ [18]
TProfile * i03_ [18]
TProfile * i04_ [18]
int ievt_
int jevt_
MonitorElementme_hs01_ [18]
MonitorElementme_hs02_ [18]
MonitorElementme_hs03_ [18]
MonitorElementmea01_ [18]
MonitorElementmea02_ [18]
MonitorElementmea03_ [18]
MonitorElementmeg01_ [18]
MonitorElementmeg02_ [18]
MonitorElementmeg03_ [18]
MonitorElementmeg04_ [18]
MonitorElementmeg05_ [18]
MonitorElementmer04_ [18]
MonitorElementmer05_ [18]
std::vector< int > MGPAGains_
std::vector< int > MGPAGainsPN_
float pedPnDiscrepancyMean_ [2]
float pedPnExpectedMean_ [2]
float pedPnRMSThreshold_ [2]
float percentVariation_
std::string prefixME_
float RMSThreshold_
std::vector< int > superModules_
bool verbose_

Friends

class EESummaryClient

Detailed Description

Definition at line 33 of file EETestPulseClient.h.


Constructor & Destructor Documentation

EETestPulseClient::EETestPulseClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 42 of file EETestPulseClient.cc.

References amplitudeThreshold_, amplitudeThresholdPnG01_, amplitudeThresholdPnG16_, cloneME_, debug_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), ha01_, ha02_, ha03_, hs01_, hs02_, hs03_, i, i01_, i02_, i03_, i04_, ecalpyutils::ism(), me_hs01_, me_hs02_, me_hs03_, mea01_, mea02_, mea03_, meg01_, meg02_, meg03_, meg04_, meg05_, mer04_, mer05_, MGPAGains_, MGPAGainsPN_, pedPnDiscrepancyMean_, pedPnExpectedMean_, pedPnRMSThreshold_, percentVariation_, prefixME_, RMSThreshold_, 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", "");

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

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

  MGPAGains_.reserve(3);
  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
  MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);

  MGPAGainsPN_.reserve(2);
  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
  MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);

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

    int ism = superModules_[i];

    ha01_[ism-1] = 0;
    ha02_[ism-1] = 0;
    ha03_[ism-1] = 0;

    hs01_[ism-1] = 0;
    hs02_[ism-1] = 0;
    hs03_[ism-1] = 0;

    i01_[ism-1] = 0;
    i02_[ism-1] = 0;
    i03_[ism-1] = 0;
    i04_[ism-1] = 0;

  }

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

    int ism = superModules_[i];

    meg01_[ism-1] = 0;
    meg02_[ism-1] = 0;
    meg03_[ism-1] = 0;

    meg04_[ism-1] = 0;
    meg05_[ism-1] = 0;

    mea01_[ism-1] = 0;
    mea02_[ism-1] = 0;
    mea03_[ism-1] = 0;

    mer04_[ism-1] = 0;
    mer05_[ism-1] = 0;

    me_hs01_[ism-1] = 0;
    me_hs02_[ism-1] = 0;
    me_hs03_[ism-1] = 0;

  }

  percentVariation_ = 0.2;
  RMSThreshold_ = 300.0;
  amplitudeThreshold_ = 10.;

  amplitudeThresholdPnG01_ = 200./16.;
  amplitudeThresholdPnG16_ = 200.;

  pedPnExpectedMean_[0] = 750.0;
  pedPnExpectedMean_[1] = 750.0;

  pedPnDiscrepancyMean_[0] = 100.0;
  pedPnDiscrepancyMean_[1] = 100.0;

  pedPnRMSThreshold_[0] = 999.;
  pedPnRMSThreshold_[1] = 999.;

}
EETestPulseClient::~EETestPulseClient ( ) [virtual]

Destructor.

Definition at line 133 of file EETestPulseClient.cc.

                                      {

}

Member Function Documentation

void EETestPulseClient::analyze ( void  ) [virtual]

Analyze.

Implements EEClient.

Definition at line 697 of file EETestPulseClient.cc.

References abs, amplitudeThreshold_, amplitudeThresholdPnG01_, amplitudeThresholdPnG16_, cloneME_, gather_cfg::cout, debug_, dqmStore_, EcalEndcap, MonitorElement::Fill(), spr::find(), DQMStore::get(), UtilsClient::getBinStatistics(), UtilsClient::getFirstNonEmptyChannel(), getHisto(), ha01_, ha02_, ha03_, hs01_, hs02_, hs03_, i, i01_, i02_, i03_, i04_, Numbers::icEE(), ievt_, Numbers::ix0EE(), Numbers::iy0EE(), jevt_, UtilsClient::maskBinContent(), Masks::maskChannel(), Masks::maskPn(), me_hs01_, me_hs02_, me_hs03_, mea01_, mea02_, mea03_, meg01_, meg02_, meg03_, meg04_, meg05_, mer04_, mer05_, MGPAGains_, MGPAGainsPN_, EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_RMS_ERROR, EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_RMS_ERROR, pedPnDiscrepancyMean_, pedPnExpectedMean_, pedPnRMSThreshold_, percentVariation_, prefixME_, MonitorElement::Reset(), RMSThreshold_, Numbers::sEE(), MonitorElement::setBinContent(), MonitorElement::setBinError(), MonitorElement::setEntries(), superModules_, EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_RMS_ERROR, EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_MEAN_ERROR, EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_RMS_ERROR, EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_MEAN_ERROR, EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_RMS_ERROR, and Numbers::validEE().

                                    {

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

  uint32_t bits01 = 0;
  bits01 |= 1 << EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_MEAN_ERROR;
  bits01 |= 1 << EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_RMS_ERROR;

  uint32_t bits02 = 0;
  bits02 |= 1 << EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_MEAN_ERROR;
  bits02 |= 1 << EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_RMS_ERROR;

  uint32_t bits03 = 0;
  bits03 |= 1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR;
  bits03 |= 1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_RMS_ERROR;

  uint32_t bits04 = 0;
  bits04 |= 1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR;
  bits04 |= 1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_RMS_ERROR;

  uint32_t bits05 = 0;
  bits05 |= 1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR;
  bits05 |= 1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_RMS_ERROR;

  MonitorElement* me;

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

    int ism = superModules_[i];

    if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
      me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain01/EETPT amplitude " + Numbers::sEE(ism) + " G01" );
      ha01_[ism-1] = UtilsClient::getHisto( me, cloneME_, ha01_[ism-1] );
    }

    if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
      me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain06/EETPT amplitude " + Numbers::sEE(ism) + " G06" );
      ha02_[ism-1] = UtilsClient::getHisto( me, cloneME_, ha02_[ism-1] );
    }

    if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
      me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain12/EETPT amplitude " + Numbers::sEE(ism) + " G12" );
      ha03_[ism-1] = UtilsClient::getHisto( me, cloneME_, ha03_[ism-1] );
    }

    if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
      me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain01/EETPT shape " + Numbers::sEE(ism) + " G01" );
      hs01_[ism-1] = UtilsClient::getHisto( me, cloneME_, hs01_[ism-1] );
    }

    if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
      me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain06/EETPT shape " + Numbers::sEE(ism) + " G06" );
      hs02_[ism-1] = UtilsClient::getHisto( me, cloneME_, hs02_[ism-1] );
    }

    if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
      me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain12/EETPT shape " + Numbers::sEE(ism) + " G12" );
      hs03_[ism-1] = UtilsClient::getHisto( me, cloneME_, hs03_[ism-1] );
    }

    if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
      me = dqmStore_->get( prefixME_ + "/EETestPulseTask/PN/Gain01/EETPT PNs amplitude " + Numbers::sEE(ism) + " G01" );
      i01_[ism-1] = UtilsClient::getHisto( me, cloneME_, i01_[ism-1] );
    }

    if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
      me = dqmStore_->get( prefixME_ + "/EETestPulseTask/PN/Gain16/EETPT PNs amplitude " + Numbers::sEE(ism) + " G16" );
      i02_[ism-1] = UtilsClient::getHisto( me, cloneME_, i02_[ism-1] );
    }

    if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
      me = dqmStore_->get( prefixME_ + "/EETestPulseTask/PN/Gain01/EETPT PNs pedestal " + Numbers::sEE(ism) + " G01" );
      i03_[ism-1] = UtilsClient::getHisto( me, cloneME_, i03_[ism-1] );
    }

    if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
      me = dqmStore_->get( prefixME_ + "/EETestPulseTask/PN/Gain16/EETPT PNs pedestal " + Numbers::sEE(ism) + " G16" );
      i04_[ism-1] = UtilsClient::getHisto( me, cloneME_, i04_[ism-1] );
    }

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

    if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
    if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();

    if ( mea01_[ism-1] ) mea01_[ism-1]->Reset();
    if ( mea02_[ism-1] ) mea02_[ism-1]->Reset();
    if ( mea03_[ism-1] ) mea03_[ism-1]->Reset();

    if ( mer04_[ism-1] ) mer04_[ism-1]->Reset();
    if ( mer05_[ism-1] ) mer05_[ism-1]->Reset();

    if ( me_hs01_[ism-1] ) me_hs01_[ism-1]->Reset();
    if ( me_hs02_[ism-1] ) me_hs02_[ism-1]->Reset();
    if ( me_hs03_[ism-1] ) me_hs03_[ism-1]->Reset();

    float meanAmpl01, meanAmpl02, meanAmpl03;

    int nCry01, nCry02, nCry03;

    meanAmpl01 = meanAmpl02 = meanAmpl03 = 0.;

    nCry01 = nCry02 = nCry03 = 0;

    for ( int ix = 1; ix <= 50; ix++ ) {
      for ( int iy = 1; iy <= 50; iy++ ) {

        bool update01;
        bool update02;
        bool update03;

        float num01, num02, num03;
        float mean01, mean02, mean03;
        float rms01, rms02, rms03;

        update01 = UtilsClient::getBinStatistics(ha01_[ism-1], ix, iy, num01, mean01, rms01);
        update02 = UtilsClient::getBinStatistics(ha02_[ism-1], ix, iy, num02, mean02, rms02);
        update03 = UtilsClient::getBinStatistics(ha03_[ism-1], ix, iy, num03, mean03, rms03);

        if ( update01 ) {
          meanAmpl01 += mean01;
          nCry01++;
        }

        if ( update02 ) {
          meanAmpl02 += mean02;
          nCry02++;
        }

        if ( update03 ) {
          meanAmpl03 += mean03;
          nCry03++;
        }

      }
    }

    if ( nCry01 > 0 ) meanAmpl01 /= float (nCry01);
    if ( nCry02 > 0 ) meanAmpl02 /= float (nCry02);
    if ( nCry03 > 0 ) meanAmpl03 /= float (nCry03);

    for ( int ix = 1; ix <= 50; ix++ ) {
      for ( int iy = 1; iy <= 50; iy++ ) {

        if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 6. );
        if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 6. );
        if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 6. );

        int jx = ix + Numbers::ix0EE(ism);
        int jy = iy + Numbers::iy0EE(ism);

        if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;

        if ( Numbers::validEE(ism, jx, jy) ) {
          if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 2. );
          if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 2. );
          if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 2. );
        }

        bool update01;
        bool update02;
        bool update03;

        float num01, num02, num03;
        float mean01, mean02, mean03;
        float rms01, rms02, rms03;

        update01 = UtilsClient::getBinStatistics(ha01_[ism-1], ix, iy, num01, mean01, rms01);
        update02 = UtilsClient::getBinStatistics(ha02_[ism-1], ix, iy, num02, mean02, rms02);
        update03 = UtilsClient::getBinStatistics(ha03_[ism-1], ix, iy, num03, mean03, rms03);

        if ( update01 ) {

          float val;

          val = 1.;
          if ( std::abs(mean01 - meanAmpl01) > std::abs(percentVariation_ * meanAmpl01) || mean01 < amplitudeThreshold_ )
            val = 0.;
          if ( rms01 > RMSThreshold_ )
            val = 0.;
          if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, val );

          int ic = Numbers::icEE(ism, jx, jy);

          if ( ic != -1 ) {
            if ( mea01_[ism-1] ) {
              if ( mean01 > 0. ) {
                mea01_[ism-1]->setBinContent( ic, mean01 );
                mea01_[ism-1]->setBinError( ic, rms01 );
              } else {
                mea01_[ism-1]->setEntries( 1.+mea01_[ism-1]->getEntries() );
              }
            }
          }

        }

        if ( update02 ) {

          float val;

          val = 1.;
          if ( std::abs(mean02 - meanAmpl02) > std::abs(percentVariation_ * meanAmpl02) || mean02 < amplitudeThreshold_ )
            val = 0.;
          if ( rms02 > RMSThreshold_ )
            val = 0.;
          if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, val );

          int ic = Numbers::icEE(ism, jx, jy);

          if ( ic != -1 ) {
            if ( mea02_[ism-1] ) {
              if ( mean02 > 0. ) {
                mea02_[ism-1]->setBinContent( ic, mean02 );
                mea02_[ism-1]->setBinError( ic, rms02 );
              } else {
                mea02_[ism-1]->setEntries( 1.+mea02_[ism-1]->getEntries() );
              }
            }
          }

        }

        if ( update03 ) {

          float val;

          val = 1.;
          if ( std::abs(mean03 - meanAmpl03) > std::abs(percentVariation_ * meanAmpl03) || mean03 < amplitudeThreshold_ )
            val = 0.;
          if ( rms03 > RMSThreshold_ )
            val = 0.;
          if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, val );

          int ic = Numbers::icEE(ism, jx, jy);

          if ( ic != -1 ) {
            if ( mea03_[ism-1] ) {
              if ( mean03 > 0. ) {
                mea03_[ism-1]->setBinContent( ic, mean03 );
                mea03_[ism-1]->setBinError( ic, rms03 );
              } else {
                mea03_[ism-1]->setEntries( 1.+mea03_[ism-1]->getEntries() );
              }
            }
          }

        }

        if ( Masks::maskChannel(ism, ix, iy, bits01, EcalEndcap) ) UtilsClient::maskBinContent( meg01_[ism-1], ix, iy );
        if ( Masks::maskChannel(ism, ix, iy, bits02, EcalEndcap) ) UtilsClient::maskBinContent( meg02_[ism-1], ix, iy );
        if ( Masks::maskChannel(ism, ix, iy, bits03, EcalEndcap) ) UtilsClient::maskBinContent( meg03_[ism-1], ix, iy );

      }
    }

    for ( int i = 1; i <= 10; i++ ) {

      if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 6. );
      if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 6. );

      // non-existing mem
      if ( (ism >=  3 && ism <=  4) || (ism >=  7 && ism <=  9) ) continue;
      if ( (ism >= 12 && ism <= 13) || (ism >= 16 && ism <= 18) ) continue;

      if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 2. );
      if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );

      bool update01;
      bool update02;
      bool update03;
      bool update04;

      float num01, num02, num03, num04;
      float mean01, mean02, mean03, mean04;
      float rms01, rms02, rms03, rms04;

      update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
      update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
      update03 = UtilsClient::getBinStatistics(i03_[ism-1], i, 0, num03, mean03, rms03);
      update04 = UtilsClient::getBinStatistics(i04_[ism-1], i, 0, num04, mean04, rms04);

      if ( mer04_[ism-1] ) mer04_[ism-1]->Fill(rms03);
      if ( mer05_[ism-1] ) mer05_[ism-1]->Fill(rms04);

      if ( update01 && update03 ) {

        float val;

        val = 1.;
        if ( mean01 < amplitudeThresholdPnG01_ )
          val = 0.;
        if ( mean03 <  pedPnExpectedMean_[0] - pedPnDiscrepancyMean_[0] ||
             pedPnExpectedMean_[0] + pedPnDiscrepancyMean_[0] < mean03)
          val = 0.;
        if ( rms03 > pedPnRMSThreshold_[0] )
          val = 0.;
        if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent(i, 1, val);

      }

      if ( update02 && update04 ) {

        float val;

        val = 1.;
        if ( mean02 < amplitudeThresholdPnG16_ )
          val = 0.;
        if ( mean04 <  pedPnExpectedMean_[1] - pedPnDiscrepancyMean_[1] ||
             pedPnExpectedMean_[1] + pedPnDiscrepancyMean_[1] < mean04)
          val = 0.;
        if ( rms04 > pedPnRMSThreshold_[1] )
          val = 0.;
        if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent(i, 1, val);

      }

      if ( Masks::maskPn(ism, i, bits01|bits04, EcalEndcap) ) UtilsClient::maskBinContent( meg04_[ism-1], i, 1 );
      if ( Masks::maskPn(ism, i, bits03|bits05, EcalEndcap) ) UtilsClient::maskBinContent( meg05_[ism-1], i, 1 );

    }

    for ( int i = 1; i <= 10; i++ ) {

      if ( hs01_[ism-1] ) {
        int ic = UtilsClient::getFirstNonEmptyChannel( hs01_[ism-1] );
        if ( me_hs01_[ism-1] ) {
          me_hs01_[ism-1]->setBinContent( i, hs01_[ism-1]->GetBinContent(ic, i) );
          me_hs01_[ism-1]->setBinError( i, hs01_[ism-1]->GetBinError(ic, i) );
        }
      }

      if ( hs02_[ism-1] ) {
        int ic = UtilsClient::getFirstNonEmptyChannel( hs02_[ism-1] );
        if ( me_hs02_[ism-1] ) {
          me_hs02_[ism-1]->setBinContent( i, hs02_[ism-1]->GetBinContent(ic, i) );
          me_hs02_[ism-1]->setBinError( i, hs02_[ism-1]->GetBinError(ic, i) );
        }
      }

      if ( hs03_[ism-1] ) {
        int ic = UtilsClient::getFirstNonEmptyChannel( hs03_[ism-1] );
        if ( me_hs03_[ism-1] ) {
          me_hs03_[ism-1]->setBinContent( i, hs03_[ism-1]->GetBinContent(ic, i) );
          me_hs03_[ism-1]->setBinError( i, hs03_[ism-1]->GetBinError(ic, i) );
        }
      }

    }

  }

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

BeginJob.

Implements EEClient.

Definition at line 137 of file EETestPulseClient.cc.

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

                                     {

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

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

  ievt_ = 0;
  jevt_ = 0;

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

BeginRun.

Implements EEClient.

Definition at line 148 of file EETestPulseClient.cc.

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

                                     {

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

  jevt_ = 0;

  this->setup();

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

Cleanup.

Implements EEClient.

Definition at line 344 of file EETestPulseClient.cc.

References cloneME_, dqmStore_, enableCleanup_, edm::getName(), ha01_, ha02_, ha03_, hs01_, hs02_, hs03_, i, i01_, i02_, i03_, i04_, ecalpyutils::ism(), me_hs01_, me_hs02_, me_hs03_, mea01_, mea02_, mea03_, meg01_, meg02_, meg03_, meg04_, meg05_, mer04_, mer05_, prefixME_, DQMStore::removeElement(), DQMStore::setCurrentFolder(), 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 ( ha01_[ism-1] ) delete ha01_[ism-1];
      if ( ha02_[ism-1] ) delete ha02_[ism-1];
      if ( ha03_[ism-1] ) delete ha03_[ism-1];

      if ( hs01_[ism-1] ) delete hs01_[ism-1];
      if ( hs02_[ism-1] ) delete hs02_[ism-1];
      if ( hs03_[ism-1] ) delete hs03_[ism-1];

      if ( i01_[ism-1] ) delete i01_[ism-1];
      if ( i02_[ism-1] ) delete i02_[ism-1];
      if ( i03_[ism-1] ) delete i03_[ism-1];
      if ( i04_[ism-1] ) delete i04_[ism-1];
    }

    ha01_[ism-1] = 0;
    ha02_[ism-1] = 0;
    ha03_[ism-1] = 0;

    hs01_[ism-1] = 0;
    hs02_[ism-1] = 0;
    hs03_[ism-1] = 0;

    i01_[ism-1] = 0;
    i02_[ism-1] = 0;
    i03_[ism-1] = 0;
    i04_[ism-1] = 0;

  }

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

    int ism = superModules_[i];

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

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

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

    if ( mea01_[ism-1] ) dqmStore_->removeElement( mea01_[ism-1]->getName() );
    mea01_[ism-1] = 0;
    if ( mea02_[ism-1] ) dqmStore_->removeElement( mea02_[ism-1]->getName() );
    mea02_[ism-1] = 0;
    if ( mea03_[ism-1] ) dqmStore_->removeElement( mea03_[ism-1]->getName() );
    mea03_[ism-1] = 0;

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

    if ( me_hs01_[ism-1] ) dqmStore_->removeElement( me_hs01_[ism-1]->getName() );
    me_hs01_[ism-1] = 0;
    if ( me_hs02_[ism-1] ) dqmStore_->removeElement( me_hs02_[ism-1]->getName() );
    me_hs02_[ism-1] = 0;
    if ( me_hs03_[ism-1] ) dqmStore_->removeElement( me_hs03_[ism-1]->getName() );
    me_hs03_[ism-1] = 0;

  }

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

EndJob.

Implements EEClient.

Definition at line 158 of file EETestPulseClient.cc.

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

                                   {

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

  this->cleanup();

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

EndRun.

Implements EEClient.

Definition at line 166 of file EETestPulseClient.cc.

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

                                   {

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

  this->cleanup();

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

Get Functions.

Implements EEClient.

Definition at line 72 of file EETestPulseClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EEClient.

Definition at line 73 of file EETestPulseClient.h.

References jevt_.

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

Setup.

Implements EEClient.

Definition at line 174 of file EETestPulseClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), dqmStore_, spr::find(), edm::getName(), i, ecalpyutils::ism(), Numbers::ix0EE(), Numbers::iy0EE(), me_hs01_, me_hs02_, me_hs03_, mea01_, mea02_, mea03_, meg01_, meg02_, meg03_, meg04_, meg05_, mer04_, mer05_, MGPAGains_, MGPAGainsPN_, mergeVDriftHistosByStation::name, prefixME_, DQMStore::removeElement(), MonitorElement::Reset(), Numbers::sEE(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), superModules_, and Numbers::validEE().

Referenced by beginRun().

                                  {

  std::string name;

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

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

    int ism = superModules_[i];

    if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
      if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
      name = "EETPT test pulse quality G01 " + Numbers::sEE(ism);
      meg01_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
      meg01_[ism-1]->setAxisTitle("ix", 1);
      if ( ism >= 1 && ism <= 9 ) meg01_[ism-1]->setAxisTitle("101-ix", 1);
      meg01_[ism-1]->setAxisTitle("iy", 2);
    }
    if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
      if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
      name = "EETPT test pulse quality G06 " + Numbers::sEE(ism);
      meg02_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
      meg02_[ism-1]->setAxisTitle("ix", 1);
      if ( ism >= 1 && ism <= 9 ) meg02_[ism-1]->setAxisTitle("101-ix", 1);
      meg02_[ism-1]->setAxisTitle("iy", 2);
    }
    if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
      if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
      name = "EETPT test pulse quality G12 " + Numbers::sEE(ism);
      meg03_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
      meg03_[ism-1]->setAxisTitle("ix", 1);
      if ( ism >= 1 && ism <= 9 ) meg03_[ism-1]->setAxisTitle("101-ix", 1);
      meg03_[ism-1]->setAxisTitle("iy", 2);
    }

    if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
      if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
      name = "EETPT test pulse quality PNs G01 " + Numbers::sEE(ism);
      meg04_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
      meg04_[ism-1]->setAxisTitle("pseudo-strip", 1);
      meg04_[ism-1]->setAxisTitle("channel", 2);
    }
    if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
      if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
      name = "EETPT test pulse quality PNs G16 " + Numbers::sEE(ism);
      meg05_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
      meg05_[ism-1]->setAxisTitle("pseudo-strip", 1);
      meg05_[ism-1]->setAxisTitle("channel", 2);
    }

    if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
      if ( mea01_[ism-1] ) dqmStore_->removeElement( mea01_[ism-1]->getName() );
      name = "EETPT test pulse amplitude G01 " + Numbers::sEE(ism);
      mea01_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
      mea01_[ism-1]->setAxisTitle("channel", 1);
      mea01_[ism-1]->setAxisTitle("amplitude", 2);
    }
    if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
      if ( mea02_[ism-1] ) dqmStore_->removeElement( mea02_[ism-1]->getName() );
      name = "EETPT test pulse amplitude G06 " + Numbers::sEE(ism);
      mea02_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
      mea02_[ism-1]->setAxisTitle("channel", 1);
      mea02_[ism-1]->setAxisTitle("amplitude", 2);
    }
    if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
      if ( mea03_[ism-1] ) dqmStore_->removeElement( mea03_[ism-1]->getName() );
      name = "EETPT test pulse amplitude G12 " + Numbers::sEE(ism);
      mea03_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
      mea03_[ism-1]->setAxisTitle("channel", 1);
      mea03_[ism-1]->setAxisTitle("amplitude", 2);
    }

    if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
      if ( mer04_[ism-1] ) dqmStore_->removeElement( mer04_[ism-1]->getName() );
      name = "EETPT PNs pedestal rms " + Numbers::sEE(ism) + " G01";
      mer04_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
      mer04_[ism-1]->setAxisTitle("rms", 1);
    }
    if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
      if ( mer05_[ism-1] ) dqmStore_->removeElement( mer05_[ism-1]->getName() );
      name = "EETPT PNs pedestal rms " + Numbers::sEE(ism) + " G16";
      mer05_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
      mer05_[ism-1]->setAxisTitle("rms", 1);
    }

    if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
      if ( me_hs01_[ism-1] ) dqmStore_->removeElement( me_hs01_[ism-1]->getName() );
      name = "EETPT test pulse shape G01 " + Numbers::sEE(ism);
      me_hs01_[ism-1] = dqmStore_->book1D(name, name, 10, 0., 10.);
      me_hs01_[ism-1]->setAxisTitle("sample", 1);
      me_hs01_[ism-1]->setAxisTitle("amplitude", 2);
    }
    if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
      if ( me_hs02_[ism-1] ) dqmStore_->removeElement( me_hs02_[ism-1]->getName() );
      name = "EETPT test pulse shape G06 " + Numbers::sEE(ism);
      me_hs02_[ism-1] = dqmStore_->book1D(name, name, 10, 0., 10.);
      me_hs02_[ism-1]->setAxisTitle("sample", 1);
      me_hs02_[ism-1]->setAxisTitle("amplitude", 2);
    }
    if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
      if ( me_hs03_[ism-1] ) dqmStore_->removeElement( me_hs03_[ism-1]->getName() );
      name = "EETPT test pulse shape G12 " + Numbers::sEE(ism);
      me_hs03_[ism-1] = dqmStore_->book1D(name, name, 10, 0., 10.);
      me_hs03_[ism-1]->setAxisTitle("sample", 1);
      me_hs03_[ism-1]->setAxisTitle("amplitude", 2);
    }

  }

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

    int ism = superModules_[i];

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

    if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
    if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();

    for ( int ix = 1; ix <= 50; ix++ ) {
      for ( int iy = 1; iy <= 50; iy++ ) {

        if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 6. );
        if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 6. );
        if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 6. );

        int jx = ix + Numbers::ix0EE(ism);
        int jy = iy + Numbers::iy0EE(ism);

        if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;

        if ( Numbers::validEE(ism, jx, jy) ) {
          if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 2. );
          if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 2. );
          if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 2. );
        }

      }
    }

    for ( int i = 1; i <= 10; i++ ) {

      if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 6. );
      if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 6. );

      // non-existing mem
      if ( (ism >=  3 && ism <=  4) || (ism >=  7 && ism <=  9) ) continue;
      if ( (ism >= 12 && ism <= 13) || (ism >= 16 && ism <= 18) ) continue;

      if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 2. );
      if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );

    }

    if ( mea01_[ism-1] ) mea01_[ism-1]->Reset();
    if ( mea02_[ism-1] ) mea02_[ism-1]->Reset();
    if ( mea03_[ism-1] ) mea03_[ism-1]->Reset();

    if ( mer04_[ism-1] ) mer04_[ism-1]->Reset();
    if ( mer05_[ism-1] ) mer05_[ism-1]->Reset();

    if ( me_hs01_[ism-1] ) me_hs01_[ism-1]->Reset();
    if ( me_hs02_[ism-1] ) me_hs02_[ism-1]->Reset();
    if ( me_hs03_[ism-1] ) me_hs03_[ism-1]->Reset();

  }

}

Friends And Related Function Documentation

friend class EESummaryClient [friend]

Definition at line 35 of file EETestPulseClient.h.


Member Data Documentation

Definition at line 130 of file EETestPulseClient.h.

Referenced by analyze(), and EETestPulseClient().

Definition at line 134 of file EETestPulseClient.h.

Referenced by analyze(), and EETestPulseClient().

Definition at line 135 of file EETestPulseClient.h.

Referenced by analyze(), and EETestPulseClient().

Definition at line 80 of file EETestPulseClient.h.

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

bool EETestPulseClient::debug_ [private]

Definition at line 83 of file EETestPulseClient.h.

Referenced by analyze(), beginJob(), beginRun(), EETestPulseClient(), endJob(), and endRun().

Definition at line 93 of file EETestPulseClient.h.

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

Definition at line 87 of file EETestPulseClient.h.

Referenced by cleanup(), and EETestPulseClient().

TProfile2D* EETestPulseClient::ha01_[18] [private]

Definition at line 95 of file EETestPulseClient.h.

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

TProfile2D* EETestPulseClient::ha02_[18] [private]

Definition at line 96 of file EETestPulseClient.h.

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

TProfile2D* EETestPulseClient::ha03_[18] [private]

Definition at line 97 of file EETestPulseClient.h.

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

TProfile2D* EETestPulseClient::hs01_[18] [private]

Definition at line 99 of file EETestPulseClient.h.

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

TProfile2D* EETestPulseClient::hs02_[18] [private]

Definition at line 100 of file EETestPulseClient.h.

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

TProfile2D* EETestPulseClient::hs03_[18] [private]

Definition at line 101 of file EETestPulseClient.h.

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

TProfile* EETestPulseClient::i01_[18] [private]

Definition at line 121 of file EETestPulseClient.h.

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

TProfile* EETestPulseClient::i02_[18] [private]

Definition at line 122 of file EETestPulseClient.h.

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

TProfile* EETestPulseClient::i03_[18] [private]

Definition at line 123 of file EETestPulseClient.h.

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

TProfile* EETestPulseClient::i04_[18] [private]

Definition at line 124 of file EETestPulseClient.h.

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

int EETestPulseClient::ievt_ [private]

Definition at line 77 of file EETestPulseClient.h.

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

int EETestPulseClient::jevt_ [private]

Definition at line 78 of file EETestPulseClient.h.

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

Definition at line 117 of file EETestPulseClient.h.

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

Definition at line 118 of file EETestPulseClient.h.

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

Definition at line 119 of file EETestPulseClient.h.

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

Definition at line 114 of file EETestPulseClient.h.

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

Definition at line 115 of file EETestPulseClient.h.

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

std::vector<int> EETestPulseClient::MGPAGains_ [private]

Definition at line 90 of file EETestPulseClient.h.

Referenced by analyze(), EETestPulseClient(), and setup().

std::vector<int> EETestPulseClient::MGPAGainsPN_ [private]

Definition at line 91 of file EETestPulseClient.h.

Referenced by analyze(), EETestPulseClient(), and setup().

Definition at line 137 of file EETestPulseClient.h.

Referenced by analyze(), and EETestPulseClient().

Definition at line 136 of file EETestPulseClient.h.

Referenced by analyze(), and EETestPulseClient().

Definition at line 138 of file EETestPulseClient.h.

Referenced by analyze(), and EETestPulseClient().

Definition at line 128 of file EETestPulseClient.h.

Referenced by analyze(), and EETestPulseClient().

std::string EETestPulseClient::prefixME_ [private]

Definition at line 85 of file EETestPulseClient.h.

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

Definition at line 129 of file EETestPulseClient.h.

Referenced by analyze(), and EETestPulseClient().

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

Definition at line 89 of file EETestPulseClient.h.

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

Definition at line 82 of file EETestPulseClient.h.

Referenced by EETestPulseClient().