CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

EETriggerTowerClient Class Reference

#include <EETriggerTowerClient.h>

Inheritance diagram for EETriggerTowerClient:
EEClient

List of all members.

Public Member Functions

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

Private Attributes

bool cloneME_
bool debug_
DQMStoredqmStore_
bool enableCleanup_
int ievt_
int jevt_
TH2F * l01_ [18]
TH2F * l02_ [18]
MonitorElementme_o01_ [18]
MonitorElementme_o02_ [18]
MonitorElementmel01_ [18]
MonitorElementmel02_ [18]
MonitorElementmeo01_ [18]
TH3F * o01_ [18]
std::string prefixME_
std::vector< int > superModules_
bool verbose_

Friends

class EESummaryClient

Detailed Description

Definition at line 35 of file EETriggerTowerClient.h.


Constructor & Destructor Documentation

EETriggerTowerClient::EETriggerTowerClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 26 of file EETriggerTowerClient.cc.

References cloneME_, debug_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), i, ecalpyutils::ism(), l01_, me_o01_, me_o02_, mel01_, meo01_, o01_, 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];

    l01_[ism-1] = 0;
    o01_[ism-1] = 0;

    mel01_[ism-1] = 0;
    meo01_[ism-1] = 0;

  }

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

    int ism = superModules_[i];

    me_o01_[ism-1] = 0;
    me_o02_[ism-1] = 0;

  }

}
EETriggerTowerClient::~EETriggerTowerClient ( ) [virtual]

Destructor.

Definition at line 71 of file EETriggerTowerClient.cc.

                                            {

}

Member Function Documentation

void EETriggerTowerClient::analyze ( void  ) [virtual]

Analyze.

Implements EEClient.

Definition at line 208 of file EETriggerTowerClient.cc.

References cloneME_, gather_cfg::cout, debug_, dqmStore_, DQMStore::get(), getHisto(), i, ievt_, getHLTprescales::index, j, jevt_, l01_, l02_, max(), me_o01_, me_o02_, mel01_, mel02_, meo01_, o01_, prefixME_, MonitorElement::Reset(), Numbers::sEE(), MonitorElement::setBinContent(), superModules_, and pileupDistInMC::total.

                                       {

  ievt_++;
  jevt_++;
  if ( ievt_ % 10 == 0 ) {
    if ( debug_ ) std::cout << "EETriggerTowerClient: 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_ + "/EETriggerTowerTask/EETTT EmulError " + Numbers::sEE(ism) );
    l01_[ism-1] = UtilsClient::getHisto( me, cloneME_, l01_[ism-1] );
    mel01_[ism-1] = me;

    me = dqmStore_->get( prefixME_ + "/EETriggerTowerTask/EETTT EmulFineGrainVetoError " + Numbers::sEE(ism) );
    l02_[ism-1] = UtilsClient::getHisto( me, cloneME_, l02_[ism-1] );
    mel02_[ism-1] = me;

    me = dqmStore_->get( prefixME_ + "/EETriggerTowerTask/EETTT EmulMatch " + Numbers::sEE(ism) );
    o01_[ism-1] = UtilsClient::getHisto( me, cloneME_, o01_[ism-1] );
    meo01_[ism-1] = me;

    if ( me_o01_[ism-1] ) me_o01_[ism-1]->Reset();
    if ( me_o02_[ism-1] ) me_o02_[ism-1]->Reset();

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

        if ( o01_[ism-1] ) {
          // find the most frequent TP timing that matches the emulator
          float index=-1;
          double max=0;
          double total=0;
          for (int j=0; j<6; j++) {
            double sampleEntries = o01_[ism-1]->GetBinContent(ix, iy, j+1);
            if(sampleEntries > max) {
              index=j;
              max = sampleEntries;
            }
            total += sampleEntries;
          }
          if ( max > 0 ) {
            if ( index == 0 ) {
              me_o01_[ism-1]->setBinContent(ix, iy, -1);
            } else {
              me_o01_[ism-1]->setBinContent(ix, iy, index );
            }
          }
          double fraction = (total > 0) ? 1.0 - max/total : 0.;
          if ( me_o02_[ism-1] ) me_o02_[ism-1]->setBinContent(ix, iy, fraction);
        }

      }
    }

  }

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

BeginJob.

Implements EEClient.

Definition at line 75 of file EETriggerTowerClient.cc.

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

                                        {

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

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

  ievt_ = 0;
  jevt_ = 0;

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

BeginRun.

Implements EEClient.

Definition at line 86 of file EETriggerTowerClient.cc.

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

                                        {

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

  jevt_ = 0;

  this->setup();

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

Cleanup.

Implements EEClient.

Definition at line 150 of file EETriggerTowerClient.cc.

References cloneME_, dqmStore_, enableCleanup_, edm::getName(), i, ecalpyutils::ism(), l01_, me_o01_, me_o02_, mel01_, meo01_, o01_, 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 ( l01_[ism-1] ) delete l01_[ism-1];
      if ( o01_[ism-1] ) delete o01_[ism-1];
    }

    l01_[ism-1] = 0;
    o01_[ism-1] = 0;

    mel01_[ism-1] = 0;
    meo01_[ism-1] = 0;

  }

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

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

    int ism = superModules_[i];

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

  }

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

EndJob.

Implements EEClient.

Definition at line 96 of file EETriggerTowerClient.cc.

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

                                      {

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

  this->cleanup();

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

EndRun.

Implements EEClient.

Definition at line 104 of file EETriggerTowerClient.cc.

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

                                      {

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

  this->cleanup();

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

Get Functions.

Implements EEClient.

Definition at line 74 of file EETriggerTowerClient.h.

References ievt_.

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

Returns the number of processed events in this Run.

Implements EEClient.

Definition at line 75 of file EETriggerTowerClient.h.

References jevt_.

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

Setup.

Implements EEClient.

Definition at line 112 of file EETriggerTowerClient.cc.

References DQMStore::book2D(), dqmStore_, edm::getName(), i, ecalpyutils::ism(), Numbers::ix0EE(), Numbers::iy0EE(), me_o01_, me_o02_, mergeVDriftHistosByStation::name, prefixME_, DQMStore::removeElement(), MonitorElement::Reset(), Numbers::sEE(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and superModules_.

Referenced by beginRun().

                                     {

  std::string name;

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

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

    int ism = superModules_[i];

    if ( me_o01_[ism-1] ) dqmStore_->removeElement( me_o01_[ism-1]->getName() );
    name = "EETTT Trigger Primitives Timing " + Numbers::sEE(ism);
    me_o01_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
    me_o01_[ism-1]->setAxisTitle("ix", 1);
    if ( ism >= 1 && ism <= 9 ) me_o01_[ism-1]->setAxisTitle("101-ix", 1);
    me_o01_[ism-1]->setAxisTitle("iy", 2);

    if ( me_o02_[ism-1] ) dqmStore_->removeElement( me_o02_[ism-1]->getName() );
    name = "EETTT Non Single Timing " + Numbers::sEE(ism);
    me_o02_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
    me_o02_[ism-1]->setAxisTitle("ix", 1);
    if ( ism >= 1 && ism <= 9 ) me_o02_[ism-1]->setAxisTitle("101-ix", 1);
    me_o02_[ism-1]->setAxisTitle("iy", 2);
    me_o02_[ism-1]->setAxisTitle("fraction", 3);

  }

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

    int ism = superModules_[i];

    if ( me_o01_[ism-1] ) me_o01_[ism-1]->Reset();
    if ( me_o02_[ism-1] ) me_o02_[ism-1]->Reset();

  }

}

Friends And Related Function Documentation

friend class EESummaryClient [friend]

Definition at line 37 of file EETriggerTowerClient.h.


Member Data Documentation

Definition at line 82 of file EETriggerTowerClient.h.

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

Definition at line 85 of file EETriggerTowerClient.h.

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

Definition at line 93 of file EETriggerTowerClient.h.

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

Definition at line 89 of file EETriggerTowerClient.h.

Referenced by cleanup(), and EETriggerTowerClient().

Definition at line 79 of file EETriggerTowerClient.h.

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

Definition at line 80 of file EETriggerTowerClient.h.

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

TH2F* EETriggerTowerClient::l01_[18] [private]
TH2F* EETriggerTowerClient::l02_[18] [private]

Definition at line 100 of file EETriggerTowerClient.h.

Referenced by EESummaryClient::analyze(), and analyze().

Definition at line 95 of file EETriggerTowerClient.h.

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

Definition at line 96 of file EETriggerTowerClient.h.

Referenced by analyze().

Definition at line 97 of file EETriggerTowerClient.h.

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

TH3F* EETriggerTowerClient::o01_[18] [private]

Definition at line 101 of file EETriggerTowerClient.h.

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

std::string EETriggerTowerClient::prefixME_ [private]

Definition at line 87 of file EETriggerTowerClient.h.

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

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

Definition at line 91 of file EETriggerTowerClient.h.

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

Definition at line 84 of file EETriggerTowerClient.h.

Referenced by EETriggerTowerClient().