CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

EBCosmicClient Class Reference

#include <EBCosmicClient.h>

Inheritance diagram for EBCosmicClient:
EBClient

List of all members.

Public Member Functions

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

Private Attributes

bool cloneME_
bool debug_
DQMStoredqmStore_
bool enableCleanup_
TProfile2D * h01_ [36]
TH1F * h02_ [36]
TH1F * h03_ [36]
int ievt_
int jevt_
MonitorElementmeh01_ [36]
MonitorElementmeh02_ [36]
MonitorElementmeh03_ [36]
std::string prefixME_
std::vector< int > superModules_
bool verbose_

Friends

class EBSummaryClient

Detailed Description

Definition at line 33 of file EBCosmicClient.h.


Constructor & Destructor Documentation

EBCosmicClient::EBCosmicClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 33 of file EBCosmicClient.cc.

References cloneME_, debug_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), h01_, h02_, h03_, i, ecalpyutils::ism(), meh01_, meh02_, meh03_, prefixME_, 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 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];

    h01_[ism-1] = 0;
    h02_[ism-1] = 0;
    h03_[ism-1] = 0;

    meh01_[ism-1] = 0;
    meh02_[ism-1] = 0;
    meh03_[ism-1] = 0;

  }

}
EBCosmicClient::~EBCosmicClient ( ) [virtual]

Destructor.

Definition at line 71 of file EBCosmicClient.cc.

                                {

}

Member Function Documentation

void EBCosmicClient::analyze ( void  ) [virtual]

Analyze.

Implements EBClient.

Definition at line 152 of file EBCosmicClient.cc.

References cloneME_, gather_cfg::cout, debug_, dqmStore_, DQMStore::get(), h01_, h02_, h03_, i, ievt_, ecalpyutils::ism(), jevt_, meh01_, meh02_, meh03_, prefixME_, Numbers::sEB(), and superModules_.

                                 {

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

  MonitorElement* me;

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

    int ism = superModules_[i];

    me = dqmStore_->get( prefixME_ + "/EBCosmicTask/Sel/EBCT energy sel " + Numbers::sEB(ism) );
    h01_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h01_[ism-1] );
    meh01_[ism-1] = me;

    me = dqmStore_->get( prefixME_ + "/EBCosmicTask/Spectrum/EBCT 1x1 energy spectrum " + Numbers::sEB(ism) );
    h02_[ism-1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h02_[ism-1] );
    meh02_[ism-1] = me;

    me = dqmStore_->get( prefixME_ + "/EBCosmicTask/Spectrum/EBCT 3x3 energy spectrum " + Numbers::sEB(ism) );
    h03_[ism-1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h03_[ism-1] );
    meh03_[ism-1] = me;

  }

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

BeginJob.

Implements EBClient.

Definition at line 75 of file EBCosmicClient.cc.

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

                                  {

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

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

  ievt_ = 0;
  jevt_ = 0;

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

BeginRun.

Implements EBClient.

Definition at line 86 of file EBCosmicClient.cc.

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

                                  {

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

  jevt_ = 0;

  this->setup();

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

Cleanup.

Implements EBClient.

Definition at line 116 of file EBCosmicClient.cc.

References cloneME_, enableCleanup_, h01_, h02_, h03_, i, ecalpyutils::ism(), meh01_, meh02_, meh03_, 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 ( h01_[ism-1] ) delete h01_[ism-1];
      if ( h02_[ism-1] ) delete h02_[ism-1];
      if ( h03_[ism-1] ) delete h03_[ism-1];
    }

    h01_[ism-1] = 0;
    h02_[ism-1] = 0;
    h03_[ism-1] = 0;

    meh01_[ism-1] = 0;
    meh02_[ism-1] = 0;
    meh03_[ism-1] = 0;

  }

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

EndJob.

Implements EBClient.

Definition at line 96 of file EBCosmicClient.cc.

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

                                {

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

  this->cleanup();

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

EndRun.

Implements EBClient.

Definition at line 104 of file EBCosmicClient.cc.

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

                                {

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

  this->cleanup();

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

Get Functions.

Implements EBClient.

Definition at line 72 of file EBCosmicClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 73 of file EBCosmicClient.h.

References jevt_.

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

Setup.

Implements EBClient.

Definition at line 112 of file EBCosmicClient.cc.

Referenced by beginRun().

                               {

}

Friends And Related Function Documentation

friend class EBSummaryClient [friend]

Definition at line 35 of file EBCosmicClient.h.


Member Data Documentation

bool EBCosmicClient::cloneME_ [private]

Definition at line 80 of file EBCosmicClient.h.

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

bool EBCosmicClient::debug_ [private]

Definition at line 83 of file EBCosmicClient.h.

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

Definition at line 91 of file EBCosmicClient.h.

Referenced by analyze(), and beginJob().

Definition at line 87 of file EBCosmicClient.h.

Referenced by cleanup(), and EBCosmicClient().

TProfile2D* EBCosmicClient::h01_[36] [private]

Definition at line 97 of file EBCosmicClient.h.

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

TH1F* EBCosmicClient::h02_[36] [private]

Definition at line 98 of file EBCosmicClient.h.

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

TH1F* EBCosmicClient::h03_[36] [private]

Definition at line 99 of file EBCosmicClient.h.

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

int EBCosmicClient::ievt_ [private]

Definition at line 77 of file EBCosmicClient.h.

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

int EBCosmicClient::jevt_ [private]

Definition at line 78 of file EBCosmicClient.h.

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

Definition at line 93 of file EBCosmicClient.h.

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

Definition at line 94 of file EBCosmicClient.h.

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

Definition at line 95 of file EBCosmicClient.h.

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

std::string EBCosmicClient::prefixME_ [private]

Definition at line 85 of file EBCosmicClient.h.

Referenced by analyze(), and EBCosmicClient().

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

Definition at line 89 of file EBCosmicClient.h.

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

bool EBCosmicClient::verbose_ [private]

Definition at line 82 of file EBCosmicClient.h.

Referenced by EBCosmicClient().