CMS 3D CMS Logo

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

DQMLumiMonitor Class Reference

#include <DQMLumiMonitor.h>

Inheritance diagram for DQMLumiMonitor:
edm::EDAnalyzer edm::EDConsumerBase

List of all members.

Public Member Functions

 DQMLumiMonitor (const edm::ParameterSet &)
 ~DQMLumiMonitor ()

Protected Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup)
void beginJob ()
void beginRun (edm::Run const &iRun, edm::EventSetup const &iSetup)
void endJob ()
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup)
void endRun (edm::Run const &iRun, edm::EventSetup const &iSetup)

Private Member Functions

void bookHistograms ()

Private Attributes

MonitorElementcorrIntLumiAndClusVsLSME_
DQMStoredbe_
std::string folderName_
float intLumi_
MonitorElementintLumiVsLSME_
std::string lumiRecordName_
unsigned long long m_cacheID_
std::string moduleName_
MonitorElementnClusME_
MonitorElementnClusVsLSME_
int nLumi_
edm::ParameterSet parameters_
edm::InputTag pixelClusterInputTag_

Detailed Description

Definition at line 29 of file DQMLumiMonitor.h.


Constructor & Destructor Documentation

DQMLumiMonitor::DQMLumiMonitor ( const edm::ParameterSet ps)
DQMLumiMonitor::~DQMLumiMonitor ( )

Definition at line 42 of file DQMLumiMonitor.cc.

                                {

}

Member Function Documentation

void DQMLumiMonitor::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
) [protected, virtual]

Implements edm::EDAnalyzer.

Definition at line 93 of file DQMLumiMonitor.cc.

References corrIntLumiAndClusVsLSME_, MonitorElement::Fill(), edm::Event::getByLabel(), intLumi_, edm::HandleBase::isValid(), nClusME_, nClusVsLSME_, nLumi_, pixelClusterInputTag_, and SiPixelClusterizer_cfi::siPixelClusters.

                                                                                 {

  //Access Pixel Clusters
  edm::Handle< edmNew::DetSetVector<SiPixelCluster> > siPixelClusters;
  //  edm::Handle< SiPixelClusterCollectionNew > siPixelClusters;
  iEvent.getByLabel(pixelClusterInputTag_, siPixelClusters);
  
  if(!siPixelClusters.isValid()) {
    edm::LogError("PixelLumiMonotor") << "Could not find Cluster Collection " << pixelClusterInputTag_;
    return;
  }
  unsigned int nClusterPix   = (*siPixelClusters).dataSize(); 
  nClusME_->Fill(nClusterPix);
  if (nLumi_ != -1) nClusVsLSME_->Fill(nLumi_, nClusterPix);
  if (intLumi_ != -1 || nLumi_ != -1) corrIntLumiAndClusVsLSME_->Fill(nLumi_, intLumi_, nClusterPix);
}
void DQMLumiMonitor::beginJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 83 of file DQMLumiMonitor.cc.

References dbe_, intLumi_, nLumi_, and cppFunctionSkipper::operator.

                              {
  dbe_ = edm::Service<DQMStore>().operator->();
  intLumi_  = -1.0; 
  nLumi_ = -1;
}
void DQMLumiMonitor::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 89 of file DQMLumiMonitor.cc.

References bookHistograms().

void DQMLumiMonitor::bookHistograms ( ) [private]

Definition at line 46 of file DQMLumiMonitor.cc.

References DQMStore::book1D(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), corrIntLumiAndClusVsLSME_, dbe_, folderName_, edm::ParameterSet::getParameter(), intLumiVsLSME_, moduleName_, nClusME_, nClusVsLSME_, parameters_, MonitorElement::Reset(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by beginRun().

                                    {
    
  edm::ParameterSet ClusHistoPar =  parameters_.getParameter<edm::ParameterSet>("TH1ClusPar");
  edm::ParameterSet LumiHistoPar =  parameters_.getParameter<edm::ParameterSet>("TH1LumiPar");
  edm::ParameterSet LumiSecHistoPar =  parameters_.getParameter<edm::ParameterSet>("TH1LSPar");

  std::string currentFolder = moduleName_ + "/" + folderName_ ;
  dbe_->setCurrentFolder(currentFolder.c_str());

  if (nClusME_ == 0) nClusME_ = dbe_->book1D("nPlxClus", " Number of Pixel Clusters ",
                                             ClusHistoPar.getParameter<int32_t>("Xbins"),
                                             ClusHistoPar.getParameter<double>("Xmin"),
                                             ClusHistoPar.getParameter<double>("Xmax"));
  else nClusME_->Reset();
  if (nClusVsLSME_ == 0) nClusVsLSME_ = dbe_->bookProfile("nClusVsLS", " Number of Pixel Cluster Vs LS number",
                                                              LumiSecHistoPar.getParameter<int32_t>("Xbins"),
                                                              LumiSecHistoPar.getParameter<double>("Xmin"),
                                                              LumiSecHistoPar.getParameter<double>("Xmax"),
                                                          0.0, 0.0, "");
  else nClusVsLSME_->Reset();
  if (intLumiVsLSME_ == 0) intLumiVsLSME_ = dbe_->bookProfile("intLumiVsLS", " Integrated Luminosity Vs LS number",
                                                              LumiSecHistoPar.getParameter<int32_t>("Xbins"),
                                                              LumiSecHistoPar.getParameter<double>("Xmin"),
                                                              LumiSecHistoPar.getParameter<double>("Xmax"),
                                                              0.0, 0.0, "");
  else intLumiVsLSME_->Reset();

  if (corrIntLumiAndClusVsLSME_== 0) corrIntLumiAndClusVsLSME_ = dbe_->bookProfile2D("corrIntLumiAndClusVsLS", " Correlation of nCluster and Integrated Luminosity Vs LS number",
                                                                                     LumiSecHistoPar.getParameter<int32_t>("Xbins"),
                                                                                     LumiSecHistoPar.getParameter<double>("Xmin"),
                                                                                     LumiSecHistoPar.getParameter<double>("Xmax"),
                                                                                     LumiHistoPar.getParameter<int32_t>("Xbins"),
                                                                                     LumiHistoPar.getParameter<double>("Xmin"),
                                                                                     LumiHistoPar.getParameter<double>("Xmax"),
                                                                                     0.0, 0.0);
  else corrIntLumiAndClusVsLSME_->Reset();
}
void DQMLumiMonitor::endJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file DQMLumiMonitor.cc.

                            {

}
void DQMLumiMonitor::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 110 of file DQMLumiMonitor.cc.

References MonitorElement::Fill(), edm::LuminosityBlock::getByLabel(), intLumi_, intLumiVsLSME_, edm::HandleBase::isValid(), edm::LuminosityBlockBase::luminosityBlock(), lumiRecordName_, nLumi_, and edm::LuminosityBlockBase::run().

                                                                                                       {
  edm::LogInfo("PixelLumiMonotor") <<" Run Number "<<lumiBlock.run() <<" Lumi Section Numnber "<< lumiBlock.luminosityBlock();

  nLumi_ = lumiBlock.luminosityBlock();

  // Access Lumi Summary
  edm::Handle<LumiSummary> lumiSummary_;
  lumiBlock.getByLabel(lumiRecordName_, lumiSummary_);
  if(lumiSummary_->isValid()){
    intLumi_ = lumiSummary_->intgDelLumi();
    edm::LogInfo("PixelLumiMonotor") <<" Luminosity in this Lumi Section " << intLumi_ ;
    intLumiVsLSME_->Fill(nLumi_, intLumi_);
  } else {
    edm::LogError("PixelLumiMonotor") << "No valid data found!";
  }
  /*
  // Access Lumi Details
  Handle<LumiDetails> lumiDetails;
  lumiBlock.getByLabel("expressLumiProducer", lumiDetails);
  if(lumiDetails->isValid()){
    std::cout<<"valid detail"<<std::endl;
  }else{
    std::cout << "no valid lumi detail data" <<std::endl;
  }  */
  
}
void DQMLumiMonitor::endRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file DQMLumiMonitor.cc.

                                                                           {

}

Member Data Documentation

Definition at line 59 of file DQMLumiMonitor.h.

Referenced by analyze(), bookHistograms(), and DQMLumiMonitor().

Definition at line 54 of file DQMLumiMonitor.h.

Referenced by beginJob(), and bookHistograms().

std::string DQMLumiMonitor::folderName_ [private]

Definition at line 50 of file DQMLumiMonitor.h.

Referenced by bookHistograms(), and DQMLumiMonitor().

float DQMLumiMonitor::intLumi_ [private]

Definition at line 61 of file DQMLumiMonitor.h.

Referenced by analyze(), beginJob(), and endLuminosityBlock().

Definition at line 57 of file DQMLumiMonitor.h.

Referenced by bookHistograms(), DQMLumiMonitor(), and endLuminosityBlock().

std::string DQMLumiMonitor::lumiRecordName_ [private]

Definition at line 52 of file DQMLumiMonitor.h.

Referenced by DQMLumiMonitor(), and endLuminosityBlock().

unsigned long long DQMLumiMonitor::m_cacheID_ [private]

Definition at line 63 of file DQMLumiMonitor.h.

std::string DQMLumiMonitor::moduleName_ [private]

Definition at line 49 of file DQMLumiMonitor.h.

Referenced by bookHistograms(), and DQMLumiMonitor().

Definition at line 56 of file DQMLumiMonitor.h.

Referenced by analyze(), bookHistograms(), and DQMLumiMonitor().

Definition at line 58 of file DQMLumiMonitor.h.

Referenced by analyze(), bookHistograms(), and DQMLumiMonitor().

int DQMLumiMonitor::nLumi_ [private]

Definition at line 62 of file DQMLumiMonitor.h.

Referenced by analyze(), beginJob(), and endLuminosityBlock().

Definition at line 47 of file DQMLumiMonitor.h.

Referenced by bookHistograms(), and DQMLumiMonitor().

Definition at line 51 of file DQMLumiMonitor.h.

Referenced by analyze(), and DQMLumiMonitor().