CMS 3D CMS Logo

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

L1TdeECALClient Class Reference

#include <L1TdeECALClient.h>

Inheritance diagram for L1TdeECALClient:
edm::EDAnalyzer

List of all members.

Public Member Functions

 L1TdeECALClient (const edm::ParameterSet &ps)
 Constructor.
virtual ~L1TdeECALClient ()
 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 ()

Private Attributes

int counterEvt_
 counter
int counterLS_
DQMStoredbe_
MonitorElementecalEtMapDiff1D_proj
 prescale on number of events
MonitorElementecalEtMapDiff1D_proj_badChs
MonitorElementecalEtMapDiff_badChs
std::string monitorDir_
edm::ParameterSet parameters_
int prescaleEvt_
 units of lumi sections
int prescaleLS_
 counter
bool verbose_

Detailed Description

Definition at line 21 of file L1TdeECALClient.h.


Constructor & Destructor Documentation

L1TdeECALClient::L1TdeECALClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 21 of file L1TdeECALClient.cc.

L1TdeECALClient::~L1TdeECALClient ( ) [virtual]

Destructor.

Definition at line 27 of file L1TdeECALClient.cc.

References gather_cfg::cout.

                                 {
 if(verbose_) cout <<"[TriggerDQM]: ending... " << endl;
}

Member Function Documentation

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

Fake Analyze.

Implements edm::EDAnalyzer.

Definition at line 158 of file L1TdeECALClient.cc.

References gather_cfg::cout, dbe_, i, and j.

                                                                      {
   counterEvt_++;
   if (prescaleEvt_<1) return;
   if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0) return;

   if(verbose_) cout << "L1TdeECALClient::analyze" << endl;

// Example: get ROOT object 
    TProfile2D * ecalEtMapDiffRoot_;   
    ecalEtMapDiffRoot_ = this->get2DProfile("L1TEMU/xpert/Ecal/EcalEtMapDiff",dbe_);


    if (ecalEtMapDiffRoot_) {
     int lastBinX=(*ecalEtMapDiffRoot_).GetNbinsX();
     int lastBinY=(*ecalEtMapDiffRoot_).GetNbinsY();
     for(int i=0; i<lastBinX ; i++){   
         for(int j=0; j<lastBinY ; j++){  
           int ibin=lastBinY*(i%lastBinX)+j; 
           if(ecalEtMapDiffRoot_->GetBinContent(i,j))
           ecalEtMapDiff1D_proj->setBinContent(ibin,ecalEtMapDiffRoot_->GetBinContent(i,j));
         }
     }
    
    }
    
   
}
void L1TdeECALClient::beginJob ( void  ) [protected, virtual]

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 57 of file L1TdeECALClient.cc.

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

                                  {

  if(verbose_) cout <<"[TriggerDQM]: Begin Job" << endl;
  // get backendinterface  
  dbe_ = Service<DQMStore>().operator->();

  // do your thing
  dbe_->setCurrentFolder(monitorDir_);
  
     ecalEtMapDiff1D_proj = dbe_->book1D("ecalEtMapDiff1D_proj","ecalEtMapDiff1D_proj",2520,0,2520.);


//   bad channels from QTs results
     ecalEtMapDiff1D_proj_badChs = dbe_->book1D("ecalEtMapDiff1D_proj_badChs","ecalEtMapDiff1D_proj_badChs",2520,0,2520.);
     ecalEtMapDiff_badChs = dbe_->book2D("ecalEtMapDiff2D_badChs","ecalEtMapDiff2D_badChs",35, -17.5, 17.5,72, -10., 350.);

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

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file L1TdeECALClient.cc.

                                                                                                    {
   // optionally reset histograms here
}
void L1TdeECALClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 76 of file L1TdeECALClient.cc.

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

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 191 of file L1TdeECALClient.cc.

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

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 84 of file L1TdeECALClient.cc.

References gather_cfg::cout, dbe_, dqm::qstatus::DISABLED, dqm::qstatus::ERROR, DQMStore::get(), MonitorElement::getEntries(), DQMStore::getMEs(), MonitorElement::getQReports(), dqm::qstatus::INSUF_STAT, dqm::qstatus::INVALID, DQMStore::pwd(), and dqm::qstatus::WARNING.

                                                 {

// retrieve all MEs in current dir
   vector<string> meVec = dbe_->getMEs();
   if(verbose_) cout << "meVec size = " << meVec.size() << endl;
   string currDir = dbe_->pwd();
   if(verbose_) cout << "currDir = " <<  currDir << endl;
    for (vector<string>::const_iterator it = meVec.begin(); it != meVec.end(); it++) {
     string full_path = currDir + "/" + (*it);
     if(verbose_) cout << "full path = " << full_path <<  endl;
     MonitorElement * me =dbe_->get(full_path);
     float me_entries=me->getEntries();

// for this MEs, get list of associated QTs

     std::vector<QReport *> Qtest_map = me->getQReports();
   
       if (Qtest_map.size() > 0) {
          for (std::vector<QReport *>::const_iterator it = Qtest_map.begin(); it != Qtest_map.end(); it++) {
             cout << endl;
             string qt_name = (*it)->getQRName();
             int qt_status = (*it)->getStatus();
             
             switch(qt_status){
               case dqm::qstatus::WARNING:
               if(verbose_) cout << "****** QT name: " << qt_name << "; Status: WARNING; "<< " Message: " << (*it)->getMessage() <<endl;
               break;
               
               case dqm::qstatus::ERROR:
               if(verbose_) cout << "****** QT name: " << qt_name << "; Status: ERROR; "<< " Message: " << (*it)->getMessage() <<endl;
               break;
       
               case dqm::qstatus::DISABLED:
               if(verbose_) cout << "****** QT name: " << qt_name << "; Status: DISABLED; "<< " Message: " << (*it)->getMessage() <<endl;
               break;
       
               case dqm::qstatus::INVALID:
               if(verbose_) cout << "****** QT name: " << qt_name << "; Status: INVALID; "<< " Message: " << (*it)->getMessage() <<endl;
               break;
       
               case dqm::qstatus::INSUF_STAT:
               if(verbose_) cout << "****** QT name: " << qt_name << "; Status: NOT ENOUGH STATISTICS; "<< " Message: " <<(*it)->getMessage() <<endl;
               if(qt_status == dqm::qstatus::INSUF_STAT) cout <<  " entries = " << me_entries << endl;
               break;
       
               default:
               if(verbose_) cout << "****** Unknown QTest qith status="<<qt_status<< endl;
             }
       
//   get bad channel list

                  std::vector<dqm::me_util::Channel> badChannels=(*it)->getBadChannels();                                                                                                                                                
                  if(!badChannels.empty() && verbose_ ) cout << " Number of channels that failed test " <<qt_name <<  " = " << badChannels.size()<< "\n";                                                                                                                                                                        
                  vector<dqm::me_util::Channel>::iterator badchsit = badChannels.begin();                                                                                                                                                
                  
                  while(badchsit != badChannels.end())                                                                                                                                                                                   
                  {                             
                    int ix = (*badchsit).getBinX();     
                    int iy = (*badchsit).getBinY();                                                                                                                                                                      
                   if(verbose_) cout <<" Bad channel ("<< ix<<"," << iy << ") with contents "<<(*badchsit).getContents() << endl;
                   if(qt_name=="testdeDiffInYRange") ecalEtMapDiff1D_proj_badChs->setBinContent(ix,(*badchsit).getContents());
                   if(qt_name=="testdeDiffInRange2DProfile") ecalEtMapDiff_badChs->setBinContent(ix,iy,(*badchsit).getContents());
                   ++badchsit;
                  }
         
       }
     }      
       
   }

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

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 187 of file L1TdeECALClient.cc.

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

Definition at line 32 of file L1TdeECALClient.cc.

References gather_cfg::cout, 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
  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
  
  monitorDir_ = parameters_.getUntrackedParameter<string>("monitorDir","");
  if(verbose_) cout << "Monitor dir = " << monitorDir_ << endl;
    
  prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1);
  if(verbose_) cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< endl;
  
  prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
  if(verbose_) cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< endl;
  

      
}

Member Data Documentation

counter

Definition at line 68 of file L1TdeECALClient.h.

Definition at line 67 of file L1TdeECALClient.h.

Definition at line 64 of file L1TdeECALClient.h.

prescale on number of events

Definition at line 73 of file L1TdeECALClient.h.

Definition at line 74 of file L1TdeECALClient.h.

Definition at line 75 of file L1TdeECALClient.h.

std::string L1TdeECALClient::monitorDir_ [private]

Definition at line 65 of file L1TdeECALClient.h.

Definition at line 62 of file L1TdeECALClient.h.

units of lumi sections

Definition at line 70 of file L1TdeECALClient.h.

counter

Definition at line 69 of file L1TdeECALClient.h.

bool L1TdeECALClient::verbose_ [private]

Definition at line 66 of file L1TdeECALClient.h.