CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

EBOccupancyClient Class Reference

#include <EBOccupancyClient.h>

Inheritance diagram for EBOccupancyClient:
EBClient

List of all members.

Public Member Functions

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

Private Attributes

bool cloneME_
bool debug_
DQMStoredqmStore_
bool enableCleanup_
TH2F * h01_ [3]
TH1F * h01ProjEta_ [3]
TH1F * h01ProjPhi_ [3]
TH2F * h02_ [2]
TH1F * h02ProjEta_ [2]
TH1F * h02ProjPhi_ [2]
TH2F * i01_ [36]
TProfile2D * i02_ [36]
int ievt_
int jevt_
std::string prefixME_
std::vector< int > superModules_
bool verbose_

Friends

class EBSummaryClient

Detailed Description

Definition at line 33 of file EBOccupancyClient.h.


Constructor & Destructor Documentation

EBOccupancyClient::EBOccupancyClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 33 of file EBOccupancyClient.cc.

References cloneME_, debug_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), h01_, h01ProjEta_, h01ProjPhi_, h02_, h02ProjEta_, h02ProjPhi_, i, i01_, i02_, ecalpyutils::ism(), 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];
    i01_[ism-1] = 0;
    i02_[ism-1] = 0;
  }

  for ( int i=0; i<3; i++) {
    h01_[i] = 0;
    h01ProjEta_[i] = 0;
    h01ProjPhi_[i] = 0;
  }

  for ( int i=0; i<2; i++) {
    h02_[i] = 0;
    h02ProjEta_[i] = 0;
    h02ProjPhi_[i] = 0;
  }

}
EBOccupancyClient::~EBOccupancyClient ( ) [virtual]

Destructor.

Definition at line 75 of file EBOccupancyClient.cc.

                                      {

}

Member Function Documentation

void EBOccupancyClient::analyze ( void  ) [virtual]

Analyze.

Implements EBClient.

Definition at line 257 of file EBOccupancyClient.cc.

References cloneME_, gather_cfg::cout, debug_, dqmStore_, DQMStore::get(), h01_, h01ProjEta_, h01ProjPhi_, h02_, h02ProjEta_, h02ProjPhi_, i, i01_, i02_, ievt_, jevt_, prefixME_, Numbers::sEB(), and superModules_.

                                    {

  ievt_++;
  jevt_++;
  if ( ievt_ % 10 == 0 ) {
    if ( debug_ ) std::cout << "EBOccupancyClient: 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_ + "/EBOccupancyTask/EBOT digi occupancy " + Numbers::sEB(ism) );
    i01_[ism-1] = UtilsClient::getHisto<TH2F*>( me, cloneME_, i01_[ism-1] );

    me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit energy " + Numbers::sEB(ism) );
    i02_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, i02_[ism-1] );

  }

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT digi occupancy" );
  h01_[0] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[0] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT digi occupancy projection eta" );
  h01ProjEta_[0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjEta_[0] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT digi occupancy projection phi" );
  h01ProjPhi_[0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[0] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit occupancy" );
  h01_[1] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[1] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit occupancy projection eta" );
  h01ProjEta_[1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjEta_[1] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit occupancy projection phi" );
  h01ProjPhi_[1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[1] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi occupancy" );
  h01_[2] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[2] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi occupancy projection eta" );
  h01ProjEta_[2] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjEta_[2] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi occupancy projection phi" );
  h01ProjPhi_[2] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[2] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit thr occupancy" );
  h02_[0] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h02_[0] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit thr occupancy projection eta" );
  h02ProjEta_[0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjEta_[0] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT rec hit thr occupancy projection phi" );
  h02ProjPhi_[0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjPhi_[0] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi thr occupancy" );
  h02_[1] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h02_[1] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi thr occupancy projection eta" );
  h02ProjEta_[1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjEta_[1] );

  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/EBOT TP digi thr occupancy projection phi" );
  h02ProjPhi_[1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjPhi_[1] );

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

BeginJob.

Implements EBClient.

Definition at line 79 of file EBOccupancyClient.cc.

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

                                     {

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

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

  ievt_ = 0;
  jevt_ = 0;

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

BeginRun.

Implements EBClient.

Definition at line 90 of file EBOccupancyClient.cc.

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

                                     {

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

  jevt_ = 0;

  this->setup();

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

Cleanup.

Implements EBClient.

Definition at line 122 of file EBOccupancyClient.cc.

References cloneME_, enableCleanup_, h01_, h01ProjEta_, h01ProjPhi_, h02_, h02ProjEta_, h02ProjPhi_, i, i01_, i02_, ecalpyutils::ism(), and superModules_.

Referenced by endJob(), and endRun().

                                    {

  if ( ! enableCleanup_ ) return;

  if ( cloneME_ ) {

    for ( unsigned int i=0; i<superModules_.size(); i++ ) {
      int ism = superModules_[i];
      if ( i01_[ism-1] ) delete i01_[ism-1];
      if ( i02_[ism-1] ) delete i02_[ism-1];
    }

    for ( int i=0; i<3; ++i ) {
      if ( h01_[i] ) delete h01_[i];
      if ( h01ProjEta_[i] ) delete h01ProjEta_[i];
      if ( h01ProjPhi_[i] ) delete h01ProjPhi_[i];
    }

    for ( int i=0; i<2; ++i ) {
      if ( h02_[i] ) delete h02_[i];
      if ( h02ProjEta_[i] ) delete h02ProjEta_[i];
      if ( h02ProjPhi_[i] ) delete h02ProjPhi_[i];
    }

  }

  for ( int i=0; i<3; ++i ) {
    h01_[i] = 0;
    h01ProjEta_[i] = 0;
    h01ProjPhi_[i] = 0;
  }

  for ( int i=0; i<2; ++i ) {
    h02_[i] = 0;
    h02ProjEta_[i] = 0;
    h02ProjPhi_[i] = 0;
  }

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

EndJob.

Implements EBClient.

Definition at line 100 of file EBOccupancyClient.cc.

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

                                   {

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

  this->cleanup();

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

EndRun.

Implements EBClient.

Definition at line 108 of file EBOccupancyClient.cc.

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

                                   {

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

  this->cleanup();

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

Get Functions.

Implements EBClient.

Definition at line 72 of file EBOccupancyClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 73 of file EBOccupancyClient.h.

References jevt_.

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

Setup.

Implements EBClient.

Definition at line 116 of file EBOccupancyClient.cc.

References dqmStore_, prefixME_, and DQMStore::setCurrentFolder().

Referenced by beginRun().

                                  {

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

}

Friends And Related Function Documentation

friend class EBSummaryClient [friend]

Definition at line 35 of file EBOccupancyClient.h.


Member Data Documentation

Definition at line 80 of file EBOccupancyClient.h.

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

bool EBOccupancyClient::debug_ [private]

Definition at line 83 of file EBOccupancyClient.h.

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

Definition at line 91 of file EBOccupancyClient.h.

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

Definition at line 87 of file EBOccupancyClient.h.

Referenced by cleanup(), and EBOccupancyClient().

TH2F* EBOccupancyClient::h01_[3] [private]

Definition at line 96 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h01ProjEta_[3] [private]

Definition at line 97 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h01ProjPhi_[3] [private]

Definition at line 98 of file EBOccupancyClient.h.

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

TH2F* EBOccupancyClient::h02_[2] [private]

Definition at line 100 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h02ProjEta_[2] [private]

Definition at line 101 of file EBOccupancyClient.h.

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

TH1F* EBOccupancyClient::h02ProjPhi_[2] [private]

Definition at line 102 of file EBOccupancyClient.h.

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

TH2F* EBOccupancyClient::i01_[36] [private]

Definition at line 93 of file EBOccupancyClient.h.

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

TProfile2D* EBOccupancyClient::i02_[36] [private]

Definition at line 94 of file EBOccupancyClient.h.

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

int EBOccupancyClient::ievt_ [private]

Definition at line 77 of file EBOccupancyClient.h.

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

int EBOccupancyClient::jevt_ [private]

Definition at line 78 of file EBOccupancyClient.h.

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

std::string EBOccupancyClient::prefixME_ [private]

Definition at line 85 of file EBOccupancyClient.h.

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

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

Definition at line 89 of file EBOccupancyClient.h.

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

Definition at line 82 of file EBOccupancyClient.h.

Referenced by EBOccupancyClient().