CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

SiStripOfflineDQM Class Reference

#include <DQM/SiStripMonitorCluster/interface/SiStripOfflineDQM.h>

Inheritance diagram for SiStripOfflineDQM:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Private Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup)
 Analyze.
void beginJob ()
 BeginJob.
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
 BeginRun.
void checkTrackerFEDs (edm::Event const &e)
void endJob ()
 Endjob.
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup)
 End Of Luminosity.
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 EndRun.
bool openInputFile ()
 Open Input File.

Private Attributes

SiStripActionExecutoractionExecutor_
edm::ParameterSet configPar_
bool createSummary_
DQMStoredqmStore_
int globalStatusFilling_
std::string inputFileName_
int nEvents_
std::string outputFileName_
bool printFaultyModuleList_
bool trackerFEDsFound_
bool usedWithEDMtoMEConverter_

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Description: DQM class to perform Summary creation Quality Test on a merged Root file after CAF processing Usage: <usage>

Definition at line 41 of file SiStripOfflineDQM.h.


Constructor & Destructor Documentation

SiStripOfflineDQM::SiStripOfflineDQM ( const edm::ParameterSet ps)

Constructor.

Construct object.

Parameters:
roPARAMETER_SETRegular Parameter Set that represent read configuration file

Definition at line 61 of file SiStripOfflineDQM.cc.

References actionExecutor_, configPar_, createSummary_, dqmStore_, edm::ParameterSet::getUntrackedParameter(), globalStatusFilling_, inputFileName_, nEvents_, cppFunctionSkipper::operator, outputFileName_, printFaultyModuleList_, and usedWithEDMtoMEConverter_.

                                                                : configPar_(pSet) {
  // Create MessageSender
  edm::LogInfo( "SiStripOfflineDQM") << "SiStripOfflineDQM::Deleting SiStripOfflineDQM ";

  // Action Executor
  actionExecutor_ = new SiStripActionExecutor(pSet);

  // get back-end interface
  dqmStore_ = edm::Service<DQMStore>().operator->();

  usedWithEDMtoMEConverter_= configPar_.getUntrackedParameter<bool>("UsedWithEDMtoMEConverter",false); 
  createSummary_           = configPar_.getUntrackedParameter<bool>("CreateSummary",false);
  inputFileName_           = configPar_.getUntrackedParameter<std::string>("InputFileName","");
  outputFileName_          = configPar_.getUntrackedParameter<std::string>("OutputFileName","");
  globalStatusFilling_     = configPar_.getUntrackedParameter<int>("GlobalStatusFilling", 1);
  printFaultyModuleList_   = configPar_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);

  nEvents_  = 0;
}
SiStripOfflineDQM::~SiStripOfflineDQM ( ) [virtual]

Destructor.

Definition at line 85 of file SiStripOfflineDQM.cc.

                                      {
  edm::LogInfo("SiStripOfflineDQM") << "SiStripOfflineDQM::Deleting SiStripOfflineDQM ";

}

Member Function Documentation

void SiStripOfflineDQM::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
) [private, virtual]

Analyze.

Executed at every Event.

Parameters:
EventEvent
eSetupEvent Setup object with Geometry, Magnetic Field, etc.

Implements edm::EDAnalyzer.

Definition at line 157 of file SiStripOfflineDQM.cc.

References nEvents_.

                                                                             {
  nEvents_++;  
}
void SiStripOfflineDQM::beginJob ( void  ) [private, virtual]

BeginJob.

Executed at the begining of application.

Parameters:
eSetupEvent Setup object

Reimplemented from edm::EDAnalyzer.

Definition at line 96 of file SiStripOfflineDQM.cc.

References actionExecutor_, createSummary_, and SiStripActionExecutor::readConfiguration().

                                 {

  // Essential: reads xml file to get the histogram names to create summary
  // Read the summary configuration file
  if (createSummary_) {  
    if (!actionExecutor_->readConfiguration()) {
      edm::LogInfo ("SiStripOfflineDQM") <<"SiStripOfflineDQM:: Error to read configuration file!! Summary will not be produced!!!";
      createSummary_ = false;
    }
  }
  edm::LogInfo("SiStripOfflineDQM") << "SiStripOfflineDQM::beginJob done";
}
void SiStripOfflineDQM::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
) [private, virtual]

BeginRun.

Executed at the begining a Run.

Parameters:
runRun object
eSetupEvent Setup object with Geometry, Magnetic Field, etc.

Reimplemented from edm::EDAnalyzer.

Definition at line 117 of file SiStripOfflineDQM.cc.

References actionExecutor_, SiStripActionExecutor::createStatus(), createSummary_, dqmStore_, edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), globalStatusFilling_, edm::ESHandleBase::isValid(), FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, openInputFile(), trackerFEDsFound_, and usedWithEDMtoMEConverter_.

                                                                               {
  edm::LogInfo ("SiStripOfflineDQM") <<"SiStripOfflineDQM:: Begining of Run";

  int nFEDs = 0;
  edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("RunInfoRcd"));
  if( eSetup.find( recordKey ) != 0) {

    edm::ESHandle<RunInfo> sumFED;
    eSetup.get<RunInfoRcd>().get(sumFED);    
    if ( sumFED.isValid() ) {

      const int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
      const int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
      
      std::vector<int> FedsInIds= sumFED->m_fed_in;   
      for(unsigned int it = 0; it < FedsInIds.size(); ++it) {
        int fedID = FedsInIds[it];     
        
        if(fedID>=siStripFedIdMin &&  fedID<=siStripFedIdMax)  ++nFEDs;
      }
    }
  }
  if (nFEDs > 0) trackerFEDsFound_ = true;
  else trackerFEDsFound_ = false;
  if (!usedWithEDMtoMEConverter_) {
    if (!openInputFile()) createSummary_ = false;
  }
  if (globalStatusFilling_ > 0) actionExecutor_->createStatus(dqmStore_);
}
void SiStripOfflineDQM::checkTrackerFEDs ( edm::Event const &  e) [private]
void SiStripOfflineDQM::endJob ( void  ) [private, virtual]

Endjob.

End Job.

Reimplemented from edm::EDAnalyzer.

Definition at line 225 of file SiStripOfflineDQM.cc.

References actionExecutor_, DQMStore::cd(), gather_cfg::cout, dqmStore_, outputFileName_, SiStripActionExecutor::printFaultyModuleList(), printFaultyModuleList_, DQMStore::save(), and usedWithEDMtoMEConverter_.

                               {

  edm::LogInfo( "SiStripOfflineDQM") << "SiStripOfflineDQM::endJob";
  if (!usedWithEDMtoMEConverter_) {
    if (printFaultyModuleList_) {
      std::ostringstream str_val;
      actionExecutor_->printFaultyModuleList(dqmStore_, str_val);
      std::cout << str_val.str() << std::endl;
    }  
    // Save Output file
    dqmStore_->cd();
    dqmStore_->save(outputFileName_, "","","");
  }
}
void SiStripOfflineDQM::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  iSetup 
) [private, virtual]

End Of Luminosity.

End Lumi.

Reimplemented from edm::EDAnalyzer.

Definition at line 166 of file SiStripOfflineDQM.cc.

References actionExecutor_, dqmStore_, SiStripActionExecutor::fillStatusAtLumi(), globalStatusFilling_, and trackerFEDsFound_.

                                                                                                         {
  edm::LogInfo( "SiStripOfflineDQM") << "SiStripOfflineDQM::endLuminosityBlock";
  if (trackerFEDsFound_) {
    if (globalStatusFilling_ > 0) actionExecutor_->fillStatusAtLumi(dqmStore_);
  }
}
void SiStripOfflineDQM::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
) [private, virtual]

EndRun.

End Run.

Reimplemented from edm::EDAnalyzer.

Definition at line 178 of file SiStripOfflineDQM.cc.

References actionExecutor_, edm::ParameterSet::augment(), configPar_, gather_cfg::cout, SiStripActionExecutor::createOfflineTkMap(), SiStripActionExecutor::createStatus(), createSummary_, SiStripActionExecutor::createSummaryOffline(), dqmStore_, SiStripActionExecutor::fillDummyStatus(), SiStripActionExecutor::fillStatus(), edm::EventSetup::get(), edm::ParameterSet::getUntrackedParameter(), globalStatusFilling_, SiStripActionExecutor::readTkMapConfiguration(), trackerFEDsFound_, and usedWithEDMtoMEConverter_.

                                                                            {

  edm::LogInfo( "SiStripOfflineDQM") << "SiStripOfflineDQM::endRun";

  // Access Cabling
  edm::ESHandle< SiStripDetCabling > det_cabling;
  eSetup.get<SiStripDetCablingRcd>().get(det_cabling);
  edm::ESHandle< SiStripFedCabling > fed_cabling;
  eSetup.get<SiStripFedCablingRcd>().get(fed_cabling);
  if (globalStatusFilling_ > 0) actionExecutor_->createStatus(dqmStore_);

  if (!trackerFEDsFound_) {
    if (globalStatusFilling_ > 0)  actionExecutor_->fillDummyStatus();
    return;
  }

  // Fill Global Status
  if (globalStatusFilling_ > 0) actionExecutor_->fillStatus(dqmStore_, det_cabling);

  if (!usedWithEDMtoMEConverter_) {

    // create Summary Plots
    if (createSummary_)  actionExecutor_->createSummaryOffline(dqmStore_);

    // Create TrackerMap
    bool create_tkmap    = configPar_.getUntrackedParameter<bool>("CreateTkMap",false); 
    if (create_tkmap) {
      std::vector<edm::ParameterSet> tkMapOptions = configPar_.getUntrackedParameter< std::vector<edm::ParameterSet> >("TkMapOptions" );
      if (actionExecutor_->readTkMapConfiguration()) {
        
        for(std::vector<edm::ParameterSet>::iterator it = tkMapOptions.begin(); it != tkMapOptions.end(); ++it) {
          edm::ParameterSet tkMapPSet = *it;
          std::string map_type = it->getUntrackedParameter<std::string>("mapName","");
          tkMapPSet.augment(configPar_.getUntrackedParameter<edm::ParameterSet>("TkmapParameters"));
          std::cout << tkMapPSet << std::endl;
          actionExecutor_->createOfflineTkMap(tkMapPSet, fed_cabling, dqmStore_, map_type); 
        }
      }
    } 
  }
}
bool SiStripOfflineDQM::openInputFile ( ) [private]

Open Input File.

Definition at line 245 of file SiStripOfflineDQM.cc.

References dqmStore_, inputFileName_, and DQMStore::open().

Referenced by beginRun().

                                      { 
  if (inputFileName_.size() == 0) return false;
  edm::LogInfo("SiStripOfflineDQM") <<  "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
  dqmStore_->open(inputFileName_, false); 
  return true;
}

Member Data Documentation

Definition at line 89 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

Definition at line 80 of file SiStripOfflineDQM.h.

Referenced by beginJob(), beginRun(), endRun(), and SiStripOfflineDQM().

Definition at line 83 of file SiStripOfflineDQM.h.

Referenced by beginRun(), endLuminosityBlock(), endRun(), and SiStripOfflineDQM().

std::string SiStripOfflineDQM::inputFileName_ [private]

Definition at line 81 of file SiStripOfflineDQM.h.

Referenced by openInputFile(), and SiStripOfflineDQM().

Definition at line 85 of file SiStripOfflineDQM.h.

Referenced by analyze(), and SiStripOfflineDQM().

std::string SiStripOfflineDQM::outputFileName_ [private]

Definition at line 82 of file SiStripOfflineDQM.h.

Referenced by endJob(), and SiStripOfflineDQM().

Definition at line 87 of file SiStripOfflineDQM.h.

Referenced by endJob(), and SiStripOfflineDQM().

Definition at line 86 of file SiStripOfflineDQM.h.

Referenced by beginRun(), endLuminosityBlock(), and endRun().

Definition at line 84 of file SiStripOfflineDQM.h.

Referenced by beginRun(), endJob(), endRun(), and SiStripOfflineDQM().