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

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 ()
 
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 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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)
 
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 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

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

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

Detailed Description

Definition at line 26 of file BeamConditionsMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file BeamConditionsMonitor.cc.

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

27  :
28  countEvt_(0),countLumi_(0) {
29 
30  parameters_ = ps;
31  monitorName_ = parameters_.getUntrackedParameter<string>("monitorName","YourSubsystemName");
33  debug_ = parameters_.getUntrackedParameter<bool>("Debug");
34 
36 
37  if (monitorName_ != "" ) monitorName_ = monitorName_+"/" ;
38 }
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet parameters_
BeamConditionsMonitor::~BeamConditionsMonitor ( )
override

Definition at line 41 of file BeamConditionsMonitor.cc.

41  {
42 }

Member Function Documentation

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

Definition at line 75 of file BeamConditionsMonitor.cc.

References condBeamSpot, countEvt_, and edm::EventSetup::get().

75  {
76 
77  countEvt_++;
78  ESHandle< BeamSpotObjects > beamhandle;
79  iSetup.get<BeamSpotObjectsRcd>().get(beamhandle);
80  condBeamSpot = *beamhandle;
81 
82 }
void BeamConditionsMonitor::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 46 of file BeamConditionsMonitor.cc.

References dbe_, MonitorElement::getTH1(), h_x0_lumi, h_y0_lumi, monitorName_, and MonitorElement::setAxisTitle().

46  {
47 
48  // book some histograms here
49  // create and cd into new folder
50  dbe_->setCurrentFolder(monitorName_+"Conditions");
51 
52  h_x0_lumi = dbe_->book1D("x0_lumi_cond","x coordinate of beam spot vs lumi (Cond)",10,0,10);
53  h_x0_lumi->setAxisTitle("Lumisection",1);
54  h_x0_lumi->setAxisTitle("x_{0} (cm)",2);
55  h_x0_lumi->getTH1()->SetOption("E1");
56 
57  h_y0_lumi = dbe_->book1D("y0_lumi_cond","y coordinate of beam spot vs lumi (Cond)",10,0,10);
58  h_y0_lumi->setAxisTitle("Lumisection",1);
59  h_y0_lumi->setAxisTitle("y_{0} (cm)",2);
60  h_y0_lumi->getTH1()->SetOption("E1");
61 
62 }
TH1 * getTH1(void) const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void BeamConditionsMonitor::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotected

Definition at line 69 of file BeamConditionsMonitor.cc.

References countLumi_.

70  {
71  countLumi_++;
72 }
void BeamConditionsMonitor::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 65 of file BeamConditionsMonitor.cc.

65  {
66 }
void BeamConditionsMonitor::endJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file BeamConditionsMonitor.cc.

References DEFINE_FWK_MODULE.

98  {
99 }
void BeamConditionsMonitor::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
overrideprotected

Definition at line 86 of file BeamConditionsMonitor.cc.

References condBeamSpot, BeamSpotObjects::GetX(), BeamSpotObjects::GetXError(), BeamSpotObjects::GetY(), BeamSpotObjects::GetYError(), h_x0_lumi, h_y0_lumi, and MonitorElement::ShiftFillLast().

87  {
88 
89  LogInfo("BeamConditions") << "[BeamConditionsMonitor]:" << condBeamSpot << endl;
92 
93 }
double GetY() const
get Y beam position
double GetYError() const
get Y beam position Error
void ShiftFillLast(double y, double ye=0., int32_t xscale=1)
double GetX() const
get X beam position
double GetXError() const
get X beam position Error
void BeamConditionsMonitor::endRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 95 of file BeamConditionsMonitor.cc.

95  {
96 }

Member Data Documentation

edm::InputTag BeamConditionsMonitor::bsSrc_
private

Definition at line 59 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor().

BeamSpotObjects BeamConditionsMonitor::condBeamSpot
private

Definition at line 68 of file BeamConditionsMonitor.h.

Referenced by analyze(), and endLuminosityBlock().

int BeamConditionsMonitor::countEvt_
private

Definition at line 64 of file BeamConditionsMonitor.h.

Referenced by analyze().

int BeamConditionsMonitor::countLumi_
private

Definition at line 65 of file BeamConditionsMonitor.h.

Referenced by beginLuminosityBlock().

DQMStore* BeamConditionsMonitor::dbe_
private

Definition at line 62 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor(), and beginJob().

bool BeamConditionsMonitor::debug_
private

Definition at line 60 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor().

MonitorElement* BeamConditionsMonitor::h_x0_lumi
private

Definition at line 71 of file BeamConditionsMonitor.h.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* BeamConditionsMonitor::h_y0_lumi
private

Definition at line 72 of file BeamConditionsMonitor.h.

Referenced by beginJob(), and endLuminosityBlock().

std::string BeamConditionsMonitor::monitorName_
private

Definition at line 58 of file BeamConditionsMonitor.h.

Referenced by BeamConditionsMonitor(), and beginJob().

edm::ParameterSet BeamConditionsMonitor::parameters_
private