CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

L1TDTTPGClient Class Reference

#include <L1TDTTPGClient.h>

Inheritance diagram for L1TDTTPGClient:
edm::EDAnalyzer

List of all members.

Public Member Functions

 L1TDTTPGClient (const edm::ParameterSet &ps)
 Constructor.
virtual ~L1TDTTPGClient ()
 Destructor.

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Fake Analyze.
void beginJob (void)
 BeginJob.
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun.
void endJob ()
 Endjob.
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 DQM Client Diagnostic.
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun.

Private Member Functions

TH1F * get1DHisto (std::string meName, DQMStore *dbi)
TProfile * get1DProfile (std::string meName, DQMStore *dbi)
TH2F * get2DHisto (std::string meName, DQMStore *dbi)
TProfile2D * get2DProfile (std::string meName, DQMStore *dbi)
void initialize ()
void makeRatioHisto (MonitorElement *ratioME, std::string &nName, std::string &dName)
void setMapPhLabel (MonitorElement *me)
void setMapThLabel (MonitorElement *me)

Private Attributes

int counterEvt_
 counter
int counterLS_
DQMStoredbe_
MonitorElementdttpgphmap2ndf
MonitorElementdttpgphmapbxf [3]
MonitorElementdttpgphmapcorrf
 prescale on number of events
MonitorElementdttpgthmapbxf [3]
MonitorElementdttpgthmaphf
std::string input_dir_
std::string monitorName_
std::string output_dir_
edm::ParameterSet parameters_
int prescaleEvt_
 units of lumi sections
int prescaleLS_
 counter

Detailed Description

Definition at line 21 of file L1TDTTPGClient.h.


Constructor & Destructor Documentation

L1TDTTPGClient::L1TDTTPGClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 23 of file L1TDTTPGClient.cc.

L1TDTTPGClient::~L1TDTTPGClient ( ) [virtual]

Destructor.

Definition at line 29 of file L1TDTTPGClient.cc.

                               {
 LogInfo("TriggerDQM")<<"[TriggerDQM]: ending... ";
}

Member Function Documentation

void L1TDTTPGClient::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

Fake Analyze.

Implements edm::EDAnalyzer.

Definition at line 120 of file L1TDTTPGClient.cc.

                                                                     {
//   cout << "L1TDTTPGClient::analyze" << endl;
   counterEvt_++;
   if (prescaleEvt_<1) return;
   if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0) return;

   string nName = "DT_TPG_phi_best_map_corr";
   string dName = "DT_TPG_phi_best_map";
   makeRatioHisto(dttpgphmapcorrf,nName,dName);
   dName = "DT_TPG_phi_map";
   nName = "DT_TPG_phi_map_2nd";
   makeRatioHisto(dttpgphmap2ndf,nName,dName);
   nName = "DT_TPG_phi_map_bx-1";
   makeRatioHisto(dttpgphmapbxf[0],nName,dName);
   nName = "DT_TPG_phi_map_bx0";
   makeRatioHisto(dttpgphmapbxf[1],nName,dName);
   nName = "DT_TPG_phi_map_bx+1";
   makeRatioHisto(dttpgphmapbxf[2],nName,dName);

   nName = "DT_TPG_theta_best_map_h";
   dName = "DT_TPG_theta_best_map";
   makeRatioHisto(dttpgthmaphf,nName,dName);
   dName = "DT_TPG_theta_map";
   nName = "DT_TPG_theta_map_bx-1";
   makeRatioHisto(dttpgthmapbxf[0],nName,dName);
   nName = "DT_TPG_theta_map_bx0";
   makeRatioHisto(dttpgthmapbxf[1],nName,dName);
   nName = "DT_TPG_theta_map_bx+1";
   makeRatioHisto(dttpgthmapbxf[2],nName,dName);


}
void L1TDTTPGClient::beginJob ( void  ) [protected, virtual]

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 60 of file L1TDTTPGClient.cc.

References DQMStore::book2D(), dbe_, cmsCodeRules::cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().

                                 {

  LogInfo("TriggerDQM")<<"[TriggerDQM]: Begin Job";

  // get backendinterface
  dbe_ = Service<DQMStore>().operator->();  

  dbe_->setCurrentFolder(output_dir_);

  // booking
  
  dttpgphmapcorrf = dbe_->book2D("DT_TPG_phi_map_corr_frac",
                                 "Fraction of correlated best triggers per station",20,1,21,12,0,12);
  dttpgphmap2ndf = dbe_->book2D("DT_TPG_phi_map_2nd_frac",
                                "Fraction of second tracks per station",20,1,21,12,0,12);
  dttpgphmapbxf[0] = dbe_->book2D("DT_TPG_phi_map_bx-1_frac",
                                  "Fraction of triggers per station (BX=-1)",20,1,21,12,0,12);
  dttpgphmapbxf[1] = dbe_->book2D("DT_TPG_phi_map_bx0_frac",
                                  "Fraction of triggers per station (BX=0)",20,1,21,12,0,12);
  dttpgphmapbxf[2] = dbe_->book2D("DT_TPG_phi_map_bx+1_frac",
                                  "Fraction of triggers per station (BX=1)",20,1,21,12,0,12);
  setMapPhLabel(dttpgphmapcorrf);
  setMapPhLabel(dttpgphmap2ndf);
  setMapPhLabel(dttpgphmapbxf[0]);
  setMapPhLabel(dttpgphmapbxf[1]);
  setMapPhLabel(dttpgphmapbxf[2]);

  dttpgthmaphf = dbe_->book2D("DT_TPG_theta_map_corr_frac",
                                 "Fraction of H quality best triggers per station",15,1,16,12,0,12);
  dttpgthmapbxf[0] = dbe_->book2D("DT_TPG_theta_map_bx-1_frac",
                                  "Fraction of triggers per station (BX=-1)",15,1,16,12,0,12);
  dttpgthmapbxf[1] = dbe_->book2D("DT_TPG_theta_map_bx0_frac",
                                  "Fraction of triggers per station (BX=0)",15,1,16,12,0,12);
  dttpgthmapbxf[2] = dbe_->book2D("DT_TPG_theta_map_bx+1_frac",
                                  "Fraction of triggers per station (BX=1)",15,1,16,12,0,12);
  setMapThLabel(dttpgthmaphf);
  setMapThLabel(dttpgthmapbxf[0]);
  setMapThLabel(dttpgthmapbxf[1]);
  setMapThLabel(dttpgthmapbxf[2]);

  

}
void L1TDTTPGClient::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file L1TDTTPGClient.cc.

                                                                                                   {
   // optionally reset histograms here
   // clientHisto->Reset();
}
void L1TDTTPGClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 105 of file L1TDTTPGClient.cc.

                                                                     {
}
void L1TDTTPGClient::endJob ( void  ) [protected, virtual]

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 158 of file L1TDTTPGClient.cc.

                           {
}
void L1TDTTPGClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
) [protected, virtual]

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 115 of file L1TDTTPGClient.cc.

                                                 {
                          
}                         
void L1TDTTPGClient::endRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 154 of file L1TDTTPGClient.cc.

                                                                  {
}
TH1F* L1TDTTPGClient::get1DHisto ( std::string  meName,
DQMStore dbi 
) [private]
TProfile* L1TDTTPGClient::get1DProfile ( std::string  meName,
DQMStore dbi 
) [private]
TH2F* L1TDTTPGClient::get2DHisto ( std::string  meName,
DQMStore dbi 
) [private]
TProfile2D* L1TDTTPGClient::get2DProfile ( std::string  meName,
DQMStore dbi 
) [private]
void L1TDTTPGClient::initialize ( ) [private]

Definition at line 34 of file L1TDTTPGClient.cc.

References dbe_, and cmsCodeRules::cppFunctionSkipper::operator.

                               { 

  counterLS_=0; 
  counterEvt_=0; 
  
  // get back-end interface
  dbe_ = Service<DQMStore>().operator->();
  
  // base folder for the contents of this job
  monitorName_ = parameters_.getUntrackedParameter<string>("monitorName","");
//  cout << "Monitor name = " << monitorName_ << endl;
  prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1);
//  cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< endl;
  prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
//  cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< endl;
  output_dir_ = parameters_.getUntrackedParameter<string>("output_dir","");
//  cout << "DQM output dir = " << output_dir_ << endl;
  input_dir_ = parameters_.getUntrackedParameter<string>("input_dir","");
//  cout << "DQM input dir = " << input_dir_ << endl;
  
  LogInfo( "TriggerDQM");

      
}
void L1TDTTPGClient::makeRatioHisto ( MonitorElement ratioME,
std::string &  nName,
std::string &  dName 
) [private]

Definition at line 161 of file L1TDTTPGClient.cc.

References dbe_, RecoTauValidation_cfi::denominator, MonitorElement::getName(), and MonitorElement::getTH2F().

{

   TH2F *numerator;
   TH2F *denominator;

   denominator = this->get2DHisto(input_dir_+"/"+dName,dbe_);
   numerator   = this->get2DHisto(input_dir_+"/"+nName,dbe_);

   if (numerator && denominator) {

     TH2F * ratio = ratioME->getTH2F();
     if (ratio) {
       ratio->Divide(numerator,denominator);
     }
     else {
       LogInfo("TriggerDQM") << "[TriggerDQM]: ratio histo named \"" << ratioME->getName() << "\" not found!" << endl;
     }
   }
   else {
     if (!numerator)
       LogInfo("TriggerDQM") << "[TriggerDQM]: numerator histo \"" << nName << "\" not found!" << endl;
     if (!denominator)
       LogInfo("TriggerDQM") << "[TriggerDQM]: denominator histo \"" << dName << "\" not found!" << endl;
   }

}
void L1TDTTPGClient::setMapPhLabel ( MonitorElement me) [private]

Definition at line 248 of file L1TDTTPGClient.cc.

References i, MonitorElement::setAxisTitle(), and MonitorElement::setBinLabel().

{

  me->setAxisTitle("DTTF Sector",2);
      for(int i=0;i<5;i++){
        ostringstream wheel;
        wheel << i-2;
        me->setBinLabel(1+i*4,"Wheel "+ wheel.str(),1);
      }
  
}
void L1TDTTPGClient::setMapThLabel ( MonitorElement me) [private]

Definition at line 261 of file L1TDTTPGClient.cc.

References i, MonitorElement::setAxisTitle(), and MonitorElement::setBinLabel().

{

  me->setAxisTitle("DTTF Sector",2);
      for(int i=0;i<5;i++){
        ostringstream wheel;
        wheel << i-2;
        me->setBinLabel(1+i*3,"Wheel "+ wheel.str(),1);
      }
  
}

Member Data Documentation

counter

Definition at line 72 of file L1TDTTPGClient.h.

Definition at line 71 of file L1TDTTPGClient.h.

Definition at line 67 of file L1TDTTPGClient.h.

Definition at line 79 of file L1TDTTPGClient.h.

Definition at line 80 of file L1TDTTPGClient.h.

prescale on number of events

Definition at line 78 of file L1TDTTPGClient.h.

Definition at line 82 of file L1TDTTPGClient.h.

Definition at line 81 of file L1TDTTPGClient.h.

std::string L1TDTTPGClient::input_dir_ [private]

Definition at line 69 of file L1TDTTPGClient.h.

std::string L1TDTTPGClient::monitorName_ [private]

Definition at line 68 of file L1TDTTPGClient.h.

std::string L1TDTTPGClient::output_dir_ [private]

Definition at line 70 of file L1TDTTPGClient.h.

Definition at line 66 of file L1TDTTPGClient.h.

units of lumi sections

Definition at line 74 of file L1TDTTPGClient.h.

counter

Definition at line 73 of file L1TDTTPGClient.h.