CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
BeamConditionsMonitor Class Reference

#include <BeamConditionsMonitor.h>

Inheritance diagram for BeamConditionsMonitor:
edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 BeamConditionsMonitor (const edm::ParameterSet &)
 
 ~BeamConditionsMonitor () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void beginJob () override
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
 
void beginRun (const edm::Run &r, const edm::EventSetup &c) override
 
void endJob () override
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
 
void endRun (const edm::Run &r, const edm::EventSetup &c) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Attributes

edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcdbeamSpotToken_
 
edm::InputTag bsSrc_
 
BeamSpotObjects condBeamSpot
 
int countEvt_
 
int countLumi_
 
DQMStoredbe_
 
bool debug_
 
MonitorElementh_x0_lumi
 
MonitorElementh_y0_lumi
 
std::string monitorName_
 
edm::ParameterSet parameters_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 26 of file BeamConditionsMonitor.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 33 of file BeamConditionsMonitor.h.

◆ MonitorElement

Definition at line 32 of file BeamConditionsMonitor.h.

Constructor & Destructor Documentation

◆ BeamConditionsMonitor()

BeamConditionsMonitor::BeamConditionsMonitor ( const edm::ParameterSet ps)

Definition at line 27 of file BeamConditionsMonitor.cc.

References beamSpotToken_, bsSrc_, dbe_, debug_, edm::EDConsumerBase::esConsumes(), edm::ParameterSet::getUntrackedParameter(), monitorName_, Utilities::operator, and parameters_.

27  : countEvt_(0), countLumi_(0) {
28  parameters_ = ps;
29  monitorName_ = parameters_.getUntrackedParameter<string>("monitorName", "YourSubsystemName");
31  debug_ = parameters_.getUntrackedParameter<bool>("Debug");
33  usesResource("DQMStore");
35 
36  if (!monitorName_.empty())
37  monitorName_ = monitorName_ + "/";
38 }
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet parameters_
edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > beamSpotToken_

◆ ~BeamConditionsMonitor()

BeamConditionsMonitor::~BeamConditionsMonitor ( )
override

Definition at line 40 of file BeamConditionsMonitor.cc.

40 {}

Member Function Documentation

◆ analyze()

void BeamConditionsMonitor::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 68 of file BeamConditionsMonitor.cc.

References beamSpotToken_, condBeamSpot, countEvt_, and edm::EventSetup::getData().

68  {
69  countEvt_++;
70  condBeamSpot = iSetup.getData(beamSpotToken_);
71 }
edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > beamSpotToken_

◆ beginJob()

void BeamConditionsMonitor::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 43 of file BeamConditionsMonitor.cc.

References dqm::implementation::IBooker::book1D(), dbe_, dqm::legacy::MonitorElement::getTH1(), h_x0_lumi, h_y0_lumi, monitorName_, dqm::impl::MonitorElement::setAxisTitle(), and dqm::implementation::DQMStore::setCurrentFolder().

43  {
44  // book some histograms here
45  // create and cd into new folder
46  dbe_->setCurrentFolder(monitorName_ + "Conditions");
47 
48  h_x0_lumi = dbe_->book1D("x0_lumi_cond", "x coordinate of beam spot vs lumi (Cond)", 10, 0, 10);
49  h_x0_lumi->setAxisTitle("Lumisection", 1);
50  h_x0_lumi->setAxisTitle("x_{0} (cm)", 2);
51  h_x0_lumi->getTH1()->SetOption("E1");
52 
53  h_y0_lumi = dbe_->book1D("y0_lumi_cond", "y coordinate of beam spot vs lumi (Cond)", 10, 0, 10);
54  h_y0_lumi->setAxisTitle("Lumisection", 1);
55  h_y0_lumi->setAxisTitle("y_{0} (cm)", 2);
56  h_y0_lumi->getTH1()->SetOption("E1");
57 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
virtual TH1 * getTH1() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ beginLuminosityBlock()

void BeamConditionsMonitor::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotected

Definition at line 63 of file BeamConditionsMonitor.cc.

References countLumi_.

63  {
64  countLumi_++;
65 }

◆ beginRun()

void BeamConditionsMonitor::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 60 of file BeamConditionsMonitor.cc.

60 {}

◆ endJob()

void BeamConditionsMonitor::endJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 82 of file BeamConditionsMonitor.cc.

82 {}

◆ endLuminosityBlock()

void BeamConditionsMonitor::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
overrideprotected

Definition at line 74 of file BeamConditionsMonitor.cc.

References condBeamSpot, h_x0_lumi, h_y0_lumi, dqm::impl::MonitorElement::ShiftFillLast(), BeamSpotObjects::x(), BeamSpotObjects::xError(), BeamSpotObjects::y(), and BeamSpotObjects::yError().

74  {
75  LogInfo("BeamConditions") << "[BeamConditionsMonitor]:" << condBeamSpot << endl;
78 }
DQM_DEPRECATED void ShiftFillLast(double y, double ye=0., int32_t xscale=1)
double x() const
get X beam position
Log< level::Info, false > LogInfo
double y() const
get Y beam position
double xError() const
get X beam position Error
double yError() const
get Y beam position Error

◆ endRun()

void BeamConditionsMonitor::endRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 80 of file BeamConditionsMonitor.cc.

80 {}

Member Data Documentation

◆ beamSpotToken_

edm::ESGetToken<BeamSpotObjects, BeamSpotObjectsRcd> BeamConditionsMonitor::beamSpotToken_
private

Definition at line 60 of file BeamConditionsMonitor.h.

Referenced by analyze(), and BeamConditionsMonitor().

◆ bsSrc_

edm::InputTag BeamConditionsMonitor::bsSrc_
private

Definition at line 59 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor().

◆ condBeamSpot

BeamSpotObjects BeamConditionsMonitor::condBeamSpot
private

Definition at line 69 of file BeamConditionsMonitor.h.

Referenced by analyze(), and endLuminosityBlock().

◆ countEvt_

int BeamConditionsMonitor::countEvt_
private

Definition at line 65 of file BeamConditionsMonitor.h.

Referenced by analyze().

◆ countLumi_

int BeamConditionsMonitor::countLumi_
private

Definition at line 66 of file BeamConditionsMonitor.h.

Referenced by beginLuminosityBlock().

◆ dbe_

DQMStore* BeamConditionsMonitor::dbe_
private

Definition at line 63 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor(), and beginJob().

◆ debug_

bool BeamConditionsMonitor::debug_
private

Definition at line 61 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor().

◆ h_x0_lumi

MonitorElement* BeamConditionsMonitor::h_x0_lumi
private

Definition at line 72 of file BeamConditionsMonitor.h.

Referenced by beginJob(), and endLuminosityBlock().

◆ h_y0_lumi

MonitorElement* BeamConditionsMonitor::h_y0_lumi
private

Definition at line 73 of file BeamConditionsMonitor.h.

Referenced by beginJob(), and endLuminosityBlock().

◆ monitorName_

std::string BeamConditionsMonitor::monitorName_
private

Definition at line 58 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor(), and beginJob().

◆ parameters_

edm::ParameterSet BeamConditionsMonitor::parameters_
private