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::EDAnalyzer edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

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::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 26 of file BeamConditionsMonitor.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 32 of file BeamConditionsMonitor.h.

◆ MonitorElement

Definition at line 31 of file BeamConditionsMonitor.h.

Constructor & Destructor Documentation

◆ BeamConditionsMonitor()

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

Definition at line 27 of file BeamConditionsMonitor.cc.

27  : countEvt_(0), countLumi_(0) {
28  parameters_ = ps;
29  monitorName_ = parameters_.getUntrackedParameter<string>("monitorName", "YourSubsystemName");
31  debug_ = parameters_.getUntrackedParameter<bool>("Debug");
33  dbe_ = Service<DQMStore>().operator->();
34 
35  if (!monitorName_.empty())
36  monitorName_ = monitorName_ + "/";
37 }

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

◆ ~BeamConditionsMonitor()

BeamConditionsMonitor::~BeamConditionsMonitor ( )
override

Definition at line 39 of file BeamConditionsMonitor.cc.

39 {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 67 of file BeamConditionsMonitor.cc.

67  {
68  countEvt_++;
69  condBeamSpot = iSetup.getData(beamSpotToken_);
70 }

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

◆ beginJob()

void BeamConditionsMonitor::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 42 of file BeamConditionsMonitor.cc.

42  {
43  // book some histograms here
44  // create and cd into new folder
45  dbe_->setCurrentFolder(monitorName_ + "Conditions");
46 
47  h_x0_lumi = dbe_->book1D("x0_lumi_cond", "x coordinate of beam spot vs lumi (Cond)", 10, 0, 10);
48  h_x0_lumi->setAxisTitle("Lumisection", 1);
49  h_x0_lumi->setAxisTitle("x_{0} (cm)", 2);
50  h_x0_lumi->getTH1()->SetOption("E1");
51 
52  h_y0_lumi = dbe_->book1D("y0_lumi_cond", "y coordinate of beam spot vs lumi (Cond)", 10, 0, 10);
53  h_y0_lumi->setAxisTitle("Lumisection", 1);
54  h_y0_lumi->setAxisTitle("y_{0} (cm)", 2);
55  h_y0_lumi->getTH1()->SetOption("E1");
56 }

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().

◆ beginLuminosityBlock()

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

Reimplemented from edm::EDAnalyzer.

Definition at line 62 of file BeamConditionsMonitor.cc.

62  {
63  countLumi_++;
64 }

References countLumi_.

◆ beginRun()

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

Reimplemented from edm::EDAnalyzer.

Definition at line 59 of file BeamConditionsMonitor.cc.

59 {}

◆ endJob()

void BeamConditionsMonitor::endJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 81 of file BeamConditionsMonitor.cc.

81 {}

◆ endLuminosityBlock()

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

◆ endRun()

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

Reimplemented from edm::EDAnalyzer.

Definition at line 79 of file BeamConditionsMonitor.cc.

79 {}

Member Data Documentation

◆ beamSpotToken_

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

Definition at line 59 of file BeamConditionsMonitor.h.

Referenced by analyze(), and BeamConditionsMonitor().

◆ bsSrc_

edm::InputTag BeamConditionsMonitor::bsSrc_
private

Definition at line 58 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor().

◆ condBeamSpot

BeamSpotObjects BeamConditionsMonitor::condBeamSpot
private

Definition at line 68 of file BeamConditionsMonitor.h.

Referenced by analyze(), and endLuminosityBlock().

◆ countEvt_

int BeamConditionsMonitor::countEvt_
private

Definition at line 64 of file BeamConditionsMonitor.h.

Referenced by analyze().

◆ countLumi_

int BeamConditionsMonitor::countLumi_
private

Definition at line 65 of file BeamConditionsMonitor.h.

Referenced by beginLuminosityBlock().

◆ dbe_

DQMStore* BeamConditionsMonitor::dbe_
private

Definition at line 62 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor(), and beginJob().

◆ debug_

bool BeamConditionsMonitor::debug_
private

Definition at line 60 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor().

◆ h_x0_lumi

MonitorElement* BeamConditionsMonitor::h_x0_lumi
private

Definition at line 71 of file BeamConditionsMonitor.h.

Referenced by beginJob(), and endLuminosityBlock().

◆ h_y0_lumi

MonitorElement* BeamConditionsMonitor::h_y0_lumi
private

Definition at line 72 of file BeamConditionsMonitor.h.

Referenced by beginJob(), and endLuminosityBlock().

◆ monitorName_

std::string BeamConditionsMonitor::monitorName_
private

Definition at line 57 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor(), and beginJob().

◆ parameters_

edm::ParameterSet BeamConditionsMonitor::parameters_
private
BeamConditionsMonitor::bsSrc_
edm::InputTag bsSrc_
Definition: BeamConditionsMonitor.h:58
BeamConditionsMonitor::h_y0_lumi
MonitorElement * h_y0_lumi
Definition: BeamConditionsMonitor.h:72
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
BeamConditionsMonitor::parameters_
edm::ParameterSet parameters_
Definition: BeamConditionsMonitor.h:56
BeamConditionsMonitor::dbe_
DQMStore * dbe_
Definition: BeamConditionsMonitor.h:62
BeamConditionsMonitor::condBeamSpot
BeamSpotObjects condBeamSpot
Definition: BeamConditionsMonitor.h:68
dqm::impl::MonitorElement::ShiftFillLast
DQM_DEPRECATED void ShiftFillLast(double y, double ye=0., int32_t xscale=1)
Definition: MonitorElement.cc:256
BeamConditionsMonitor::monitorName_
std::string monitorName_
Definition: BeamConditionsMonitor.h:57
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:475
BeamSpotObjects::GetXError
double GetXError() const
get X beam position Error
Definition: BeamSpotObjects.h:85
BeamSpotObjects::GetY
double GetY() const
get Y beam position
Definition: BeamSpotObjects.h:69
edm::Service
Definition: Service.h:30
BeamConditionsMonitor::h_x0_lumi
MonitorElement * h_x0_lumi
Definition: BeamConditionsMonitor.h:71
BeamConditionsMonitor::debug_
bool debug_
Definition: BeamConditionsMonitor.h:60
BeamSpotObjects::GetYError
double GetYError() const
get Y beam position Error
Definition: BeamSpotObjects.h:87
BeamConditionsMonitor::countLumi_
int countLumi_
Definition: BeamConditionsMonitor.h:65
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:206
BeamConditionsMonitor::countEvt_
int countEvt_
Definition: BeamConditionsMonitor.h:64
BeamSpotObjects::GetX
double GetX() const
get X beam position
Definition: BeamSpotObjects.h:67
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
BeamConditionsMonitor::beamSpotToken_
edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > beamSpotToken_
Definition: BeamConditionsMonitor.h:59
edm::InputTag
Definition: InputTag.h:15
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98