CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

EECosmicClient Class Reference

#include <EECosmicClient.h>

Inheritance diagram for EECosmicClient:
EEClient

List of all members.

Public Member Functions

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

Private Attributes

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

Friends

class EESummaryClient

Detailed Description

Definition at line 33 of file EECosmicClient.h.


Constructor & Destructor Documentation

EECosmicClient::EECosmicClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 31 of file EECosmicClient.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 18).
  superModules_.reserve(18);
  for ( unsigned int i = 1; i <= 18; 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;

  }

}
EECosmicClient::~EECosmicClient ( ) [virtual]

Destructor.

Definition at line 69 of file EECosmicClient.cc.

                                {

}

Member Function Documentation

void EECosmicClient::analyze ( void  ) [virtual]

Analyze.

Implements EEClient.

Definition at line 150 of file EECosmicClient.cc.

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

                                 {

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

  char histo[200];

  MonitorElement* me;

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

    int ism = superModules_[i];

    sprintf(histo, (prefixME_ + "/EECosmicTask/Sel/EECT energy sel %s").c_str(), Numbers::sEE(ism).c_str());
    me = dqmStore_->get(histo);
    h01_[ism-1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h01_[ism-1] );
    meh01_[ism-1] = me;

    sprintf(histo, (prefixME_ + "/EECosmicTask/Spectrum/EECT 1x1 energy spectrum %s").c_str(), Numbers::sEE(ism).c_str());
    me = dqmStore_->get(histo);
    h02_[ism-1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h02_[ism-1] );
    meh02_[ism-1] = me;

    sprintf(histo, (prefixME_ + "/EECosmicTask/Spectrum/EECT 3x3 energy spectrum %s").c_str(), Numbers::sEE(ism).c_str());
    me = dqmStore_->get(histo);
    h03_[ism-1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h03_[ism-1] );
    meh03_[ism-1] = me;

  }

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

BeginJob.

Implements EEClient.

Definition at line 73 of file EECosmicClient.cc.

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

                                  {

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

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

  ievt_ = 0;
  jevt_ = 0;

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

BeginRun.

Implements EEClient.

Definition at line 84 of file EECosmicClient.cc.

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

                                  {

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

  jevt_ = 0;

  this->setup();

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

Cleanup.

Implements EEClient.

Definition at line 114 of file EECosmicClient.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 EECosmicClient::endJob ( void  ) [virtual]

EndJob.

Implements EEClient.

Definition at line 94 of file EECosmicClient.cc.

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

                                {

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

  this->cleanup();

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

EndRun.

Implements EEClient.

Definition at line 102 of file EECosmicClient.cc.

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

                                {

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

  this->cleanup();

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

Get Functions.

Implements EEClient.

Definition at line 72 of file EECosmicClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EEClient.

Definition at line 73 of file EECosmicClient.h.

References jevt_.

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

Setup.

Implements EEClient.

Definition at line 110 of file EECosmicClient.cc.

Referenced by beginRun().

                               {

}

Friends And Related Function Documentation

friend class EESummaryClient [friend]

Definition at line 35 of file EECosmicClient.h.


Member Data Documentation

bool EECosmicClient::cloneME_ [private]

Definition at line 80 of file EECosmicClient.h.

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

bool EECosmicClient::debug_ [private]

Definition at line 83 of file EECosmicClient.h.

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

Definition at line 91 of file EECosmicClient.h.

Referenced by analyze(), and beginJob().

Definition at line 87 of file EECosmicClient.h.

Referenced by cleanup(), and EECosmicClient().

TProfile2D* EECosmicClient::h01_[18] [private]

Definition at line 97 of file EECosmicClient.h.

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

TH1F* EECosmicClient::h02_[18] [private]

Definition at line 98 of file EECosmicClient.h.

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

TH1F* EECosmicClient::h03_[18] [private]

Definition at line 99 of file EECosmicClient.h.

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

int EECosmicClient::ievt_ [private]

Definition at line 77 of file EECosmicClient.h.

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

int EECosmicClient::jevt_ [private]

Definition at line 78 of file EECosmicClient.h.

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

Definition at line 93 of file EECosmicClient.h.

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

Definition at line 94 of file EECosmicClient.h.

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

Definition at line 95 of file EECosmicClient.h.

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

std::string EECosmicClient::prefixME_ [private]

Definition at line 85 of file EECosmicClient.h.

Referenced by analyze(), and EECosmicClient().

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

Definition at line 89 of file EECosmicClient.h.

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

bool EECosmicClient::verbose_ [private]

Definition at line 82 of file EECosmicClient.h.

Referenced by EECosmicClient().