#include <BeamConditionsMonitor.h>
Public Member Functions | |
BeamConditionsMonitor (const edm::ParameterSet &) | |
~BeamConditionsMonitor () | |
Protected Member Functions | |
void | analyze (const edm::Event &e, const edm::EventSetup &c) |
void | beginJob () |
void | beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) |
void | beginRun (const edm::Run &r, const edm::EventSetup &c) |
void | endJob () |
void | endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) |
void | endRun (const edm::Run &r, const edm::EventSetup &c) |
Private Attributes | |
edm::InputTag | bsSrc_ |
BeamSpotObjects | condBeamSpot |
int | countEvt_ |
int | countLumi_ |
DQMStore * | dbe_ |
bool | debug_ |
MonitorElement * | h_x0_lumi |
MonitorElement * | h_y0_lumi |
std::string | monitorName_ |
edm::ParameterSet | parameters_ |
BeamConditionsMonitor::BeamConditionsMonitor | ( | const edm::ParameterSet & | ps | ) |
Definition at line 29 of file BeamConditionsMonitor.cc.
References bsSrc_, dbe_, debug_, edm::ParameterSet::getUntrackedParameter(), monitorName_, cppFunctionSkipper::operator, and parameters_.
: countEvt_(0),countLumi_(0) { parameters_ = ps; monitorName_ = parameters_.getUntrackedParameter<string>("monitorName","YourSubsystemName"); bsSrc_ = parameters_.getUntrackedParameter<InputTag>("beamSpot"); debug_ = parameters_.getUntrackedParameter<bool>("Debug"); dbe_ = Service<DQMStore>().operator->(); if (monitorName_ != "" ) monitorName_ = monitorName_+"/" ; }
BeamConditionsMonitor::~BeamConditionsMonitor | ( | ) |
Definition at line 43 of file BeamConditionsMonitor.cc.
{ }
void BeamConditionsMonitor::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Implements edm::EDAnalyzer.
Definition at line 77 of file BeamConditionsMonitor.cc.
References condBeamSpot, countEvt_, and edm::EventSetup::get().
{ countEvt_++; ESHandle< BeamSpotObjects > beamhandle; iSetup.get<BeamSpotObjectsRcd>().get(beamhandle); condBeamSpot = *beamhandle; }
void BeamConditionsMonitor::beginJob | ( | void | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 48 of file BeamConditionsMonitor.cc.
References DQMStore::book1D(), dbe_, MonitorElement::getTH1(), h_x0_lumi, h_y0_lumi, monitorName_, MonitorElement::setAxisTitle(), and DQMStore::setCurrentFolder().
{ // book some histograms here // create and cd into new folder dbe_->setCurrentFolder(monitorName_+"Conditions"); h_x0_lumi = dbe_->book1D("x0_lumi_cond","x coordinate of beam spot vs lumi (Cond)",10,0,10); h_x0_lumi->setAxisTitle("Lumisection",1); h_x0_lumi->setAxisTitle("x_{0} (cm)",2); h_x0_lumi->getTH1()->SetOption("E1"); h_y0_lumi = dbe_->book1D("y0_lumi_cond","y coordinate of beam spot vs lumi (Cond)",10,0,10); h_y0_lumi->setAxisTitle("Lumisection",1); h_y0_lumi->setAxisTitle("y_{0} (cm)",2); h_y0_lumi->getTH1()->SetOption("E1"); }
void BeamConditionsMonitor::beginLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, |
const edm::EventSetup & | context | ||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 71 of file BeamConditionsMonitor.cc.
References countLumi_.
{ countLumi_++; }
void BeamConditionsMonitor::beginRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
void BeamConditionsMonitor::endJob | ( | void | ) | [protected, virtual] |
void BeamConditionsMonitor::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 88 of file BeamConditionsMonitor.cc.
References condBeamSpot, BeamSpotObjects::GetX(), BeamSpotObjects::GetXError(), BeamSpotObjects::GetY(), BeamSpotObjects::GetYError(), h_x0_lumi, h_y0_lumi, and MonitorElement::ShiftFillLast().
{ LogInfo("BeamConditions") << "[BeamConditionsMonitor]:" << condBeamSpot << endl; h_x0_lumi->ShiftFillLast( condBeamSpot.GetX(), condBeamSpot.GetXError(), 1 ); h_y0_lumi->ShiftFillLast( condBeamSpot.GetY(), condBeamSpot.GetYError(), 1 ); }
void BeamConditionsMonitor::endRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
edm::InputTag BeamConditionsMonitor::bsSrc_ [private] |
Definition at line 61 of file BeamConditionsMonitor.h.
Referenced by BeamConditionsMonitor().
Definition at line 70 of file BeamConditionsMonitor.h.
Referenced by analyze(), and endLuminosityBlock().
int BeamConditionsMonitor::countEvt_ [private] |
Definition at line 66 of file BeamConditionsMonitor.h.
Referenced by analyze().
int BeamConditionsMonitor::countLumi_ [private] |
Definition at line 67 of file BeamConditionsMonitor.h.
Referenced by beginLuminosityBlock().
DQMStore* BeamConditionsMonitor::dbe_ [private] |
Definition at line 64 of file BeamConditionsMonitor.h.
Referenced by BeamConditionsMonitor(), and beginJob().
bool BeamConditionsMonitor::debug_ [private] |
Definition at line 62 of file BeamConditionsMonitor.h.
Referenced by BeamConditionsMonitor().
MonitorElement* BeamConditionsMonitor::h_x0_lumi [private] |
Definition at line 73 of file BeamConditionsMonitor.h.
Referenced by beginJob(), and endLuminosityBlock().
MonitorElement* BeamConditionsMonitor::h_y0_lumi [private] |
Definition at line 74 of file BeamConditionsMonitor.h.
Referenced by beginJob(), and endLuminosityBlock().
std::string BeamConditionsMonitor::monitorName_ [private] |
Definition at line 60 of file BeamConditionsMonitor.h.
Referenced by BeamConditionsMonitor(), and beginJob().
Definition at line 59 of file BeamConditionsMonitor.h.
Referenced by BeamConditionsMonitor().