CMS 3D CMS Logo

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

#include <BeamConditionsMonitor.h>

Inheritance diagram for BeamConditionsMonitor:
DQMGlobalEDAnalyzer< beamcond::RunCache, edm::LuminosityBlockCache< void > > edm::global::EDAnalyzer< edm::RunCache< beamcond::RunCache >, Args... > edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 BeamConditionsMonitor (const edm::ParameterSet &)
 
 ~BeamConditionsMonitor () override=default
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::RunCache< beamcond::RunCache >, Args... >
 EDAnalyzer ()=default
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void bookHistograms (DQMStore::ConcurrentBooker &i, const edm::Run &r, const edm::EventSetup &c, beamcond::RunCache &) const override
 
void dqmAnalyze (const edm::Event &e, const edm::EventSetup &c, beamcond::RunCache const &) const override
 
std::shared_ptr< void > globalBeginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) const override
 
void globalEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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<typename ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, ESInputTag const &tag)
 
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)
 

Private Attributes

const edm::InputTag bsSrc_
 
std::string monitorName_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 30 of file BeamConditionsMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 29 of file BeamConditionsMonitor.cc.

References edm::ParameterSet::getUntrackedParameter(), and monitorName_.

29  :
30  bsSrc_{ps.getUntrackedParameter<InputTag>("beamSpot")}
31 
32  {
33 
34  monitorName_ = ps.getUntrackedParameter<string>("monitorName","YourSubsystemName");
35 
36  if (!monitorName_.empty() ) monitorName_ = monitorName_+"/" ;
37 }
T getUntrackedParameter(std::string const &, T const &) const
const edm::InputTag bsSrc_
BeamConditionsMonitor::~BeamConditionsMonitor ( )
overridedefault

Member Function Documentation

void BeamConditionsMonitor::bookHistograms ( DQMStore::ConcurrentBooker i,
const edm::Run r,
const edm::EventSetup c,
beamcond::RunCache cache 
) const
overrideprotected

Definition at line 41 of file BeamConditionsMonitor.cc.

References DQMStore::ConcurrentBooker::book1D(), beamcond::RunCache::h_x0_lumi, beamcond::RunCache::h_y0_lumi, monitorName_, ConcurrentMonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and ConcurrentMonitorElement::setOption().

42  {
43 
44  // book some histograms here
45  // create and cd into new folder
46  i.setCurrentFolder(monitorName_+"Conditions");
47 
48  cache.h_x0_lumi = i.book1D("x0_lumi_cond","x coordinate of beam spot vs lumi (Cond)",10,0,10);
49  cache.h_x0_lumi.setAxisTitle("Lumisection",1);
50  cache.h_x0_lumi.setAxisTitle("x_{0} (cm)",2);
51  cache.h_x0_lumi.setOption("E1");
52 
53  cache.h_y0_lumi = i.book1D("y0_lumi_cond","y coordinate of beam spot vs lumi (Cond)",10,0,10);
54  cache.h_y0_lumi.setAxisTitle("Lumisection",1);
55  cache.h_y0_lumi.setAxisTitle("y_{0} (cm)",2);
56  cache.h_y0_lumi.setOption("E1");
57 
58 }
void setOption(const char *option)
ConcurrentMonitorElement h_x0_lumi
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
ConcurrentMonitorElement book1D(Args &&...args)
Definition: DQMStore.h:160
void setAxisTitle(std::string const &title, int axis=1)
ConcurrentMonitorElement h_y0_lumi
void BeamConditionsMonitor::dqmAnalyze ( const edm::Event e,
const edm::EventSetup c,
beamcond::RunCache const &   
) const
overrideprotected

Definition at line 77 of file BeamConditionsMonitor.cc.

78  {
79 
80 }
std::shared_ptr< void > BeamConditionsMonitor::globalBeginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
) const
overrideprotected

Definition at line 62 of file BeamConditionsMonitor.cc.

References helperFunctions::cache(), edm::EventSetup::get(), edm::LuminosityBlock::getRun(), and edm::Run::index().

63  {
64  ESHandle< BeamSpotObjects > beamhandle;
65  c.get<BeamSpotObjectsRcd>().get(beamhandle);
66  auto const& condBeamSpot = *beamhandle;
67 
68  auto cache = runCache(lumiSeg.getRun().index() );
69  LogInfo("BeamConditions") << "[BeamConditionsMonitor]:" << condBeamSpot << endl;
70  cache->h_x0_lumi.shiftFillLast( condBeamSpot.GetX(), condBeamSpot.GetXError(), 1 );
71  cache->h_y0_lumi.shiftFillLast( condBeamSpot.GetY(), condBeamSpot.GetYError(), 1 );
72 
73  return std::shared_ptr<void>{};
74 }
RunIndex index() const
Definition: Run.cc:24
def cache(function)
T get() const
Definition: EventSetup.h:68
Run const & getRun() const
void BeamConditionsMonitor::globalEndLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
) const
overrideprotected

Definition at line 84 of file BeamConditionsMonitor.cc.

References DEFINE_FWK_MODULE.

85  {
86 
87 
88 }

Member Data Documentation

const edm::InputTag BeamConditionsMonitor::bsSrc_
private

Definition at line 51 of file BeamConditionsMonitor.h.

std::string BeamConditionsMonitor::monitorName_
private

Definition at line 50 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor(), and bookHistograms().