CMS 3D CMS Logo

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

#include <ESDcsInfoTask.h>

Inheritance diagram for ESDcsInfoTask:
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

 ESDcsInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~ESDcsInfoTask () override
 Destructor. More...
 
- 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
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
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
 Analyze. More...
 
void beginJob (void) override
 BeginJob. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) override
 BeginLuminosityBlock. More...
 
void endJob (void) override
 EndJob. More...
 
void reset (void)
 Reset. More...
 
- 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>
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)
 
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::EDGetTokenT< DcsStatusCollectiondcsStatustoken_
 
DQMStoredqmStore_
 
int ievt_
 
MonitorElementmeESDcsActiveMap_
 
MonitorElementmeESDcsFraction_
 
bool mergeRuns_
 
std::string prefixME_
 

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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 11 of file ESDcsInfoTask.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 14 of file ESDcsInfoTask.h.

◆ MonitorElement

Definition at line 13 of file ESDcsInfoTask.h.

Constructor & Destructor Documentation

◆ ESDcsInfoTask()

ESDcsInfoTask::ESDcsInfoTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 19 of file ESDcsInfoTask.cc.

19  {
20  dqmStore_ = Service<DQMStore>().operator->();
21 
22  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
23 
24  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
25 
26  dcsStatustoken_ = consumes<DcsStatusCollection>(ps.getParameter<InputTag>("DcsStatusLabel"));
27 
28  meESDcsFraction_ = nullptr;
29  meESDcsActiveMap_ = nullptr;
30 }

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

◆ ~ESDcsInfoTask()

ESDcsInfoTask::~ESDcsInfoTask ( )
override

Destructor.

Definition at line 32 of file ESDcsInfoTask.cc.

32 {}

Member Function Documentation

◆ analyze()

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 68 of file ESDcsInfoTask.cc.

68  {
69  ievt_++;
70 
71  float ESpDcsStatus = 0;
72  float ESmDcsStatus = 0;
73 
75  e.getByToken(dcsStatustoken_, dcsStatus);
76  if (dcsStatus.isValid()) {
77  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin(); dcsStatusItr != dcsStatus->end();
78  ++dcsStatusItr) {
79  ESpDcsStatus = dcsStatusItr->ready(DcsStatus::ESp);
80  ESmDcsStatus = dcsStatusItr->ready(DcsStatus::ESm);
81  }
82 
83  ESpDcsStatus = (ESpDcsStatus + float(ievt_ - 1) * meESDcsActiveMap_->getBinContent(1)) / float(ievt_);
84  ESmDcsStatus = (ESmDcsStatus + float(ievt_ - 1) * meESDcsActiveMap_->getBinContent(2)) / float(ievt_);
85  }
86 
87  meESDcsActiveMap_->setBinContent(1, ESpDcsStatus);
88  meESDcsActiveMap_->setBinContent(2, ESmDcsStatus);
89 
90  meESDcsFraction_->Fill((ESpDcsStatus + ESmDcsStatus) / 2.);
91 }

References MillePedeFileConverter_cfg::e, DcsStatus::ESm, DcsStatus::ESp, dqmMemoryStats::float, and edm::HandleBase::isValid().

◆ beginJob()

void ESDcsInfoTask::beginJob ( void  )
overrideprotectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 34 of file ESDcsInfoTask.cc.

34  {
35  char histo[200];
36 
37  if (dqmStore_) {
38  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
39 
40  sprintf(histo, "DCSSummary");
42  meESDcsFraction_->Fill(-1.0);
43 
44  sprintf(histo, "DCSSummaryMap");
46  meESDcsActiveMap_->setAxisTitle("(ES+/ES-)", 1);
47  }
48 }

References timingPdfMaker::histo.

◆ beginLuminosityBlock()

void ESDcsInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 52 of file ESDcsInfoTask.cc.

52  {
53  this->reset();
54 
55  for (int i = 0; i < 2; i++) {
56  meESDcsActiveMap_->setBinContent(i + 1, -1.0);
57  }
58 }

References mps_fire::i, and reset().

◆ endJob()

void ESDcsInfoTask::endJob ( void  )
overrideprotectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 50 of file ESDcsInfoTask.cc.

50 {}

◆ reset()

void ESDcsInfoTask::reset ( void  )
protected

Reset.

Definition at line 60 of file ESDcsInfoTask.cc.

60  {
61  if (meESDcsFraction_)
63 
66 }

Member Data Documentation

◆ dcsStatustoken_

edm::EDGetTokenT<DcsStatusCollection> ESDcsInfoTask::dcsStatustoken_
private

Definition at line 45 of file ESDcsInfoTask.h.

◆ dqmStore_

DQMStore* ESDcsInfoTask::dqmStore_
private

Definition at line 39 of file ESDcsInfoTask.h.

◆ ievt_

int ESDcsInfoTask::ievt_
private

Definition at line 50 of file ESDcsInfoTask.h.

◆ meESDcsActiveMap_

MonitorElement* ESDcsInfoTask::meESDcsActiveMap_
private

Definition at line 48 of file ESDcsInfoTask.h.

◆ meESDcsFraction_

MonitorElement* ESDcsInfoTask::meESDcsFraction_
private

Definition at line 47 of file ESDcsInfoTask.h.

◆ mergeRuns_

bool ESDcsInfoTask::mergeRuns_
private

Definition at line 43 of file ESDcsInfoTask.h.

◆ prefixME_

std::string ESDcsInfoTask::prefixME_
private

Definition at line 41 of file ESDcsInfoTask.h.

mps_fire.i
i
Definition: mps_fire.py:355
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
ESDcsInfoTask::reset
void reset(void)
Reset.
Definition: ESDcsInfoTask.cc:60
DcsStatus::ESp
Definition: DcsStatus.h:57
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
ESDcsInfoTask::dqmStore_
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:39
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ESDcsInfoTask::meESDcsActiveMap_
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
edm::Handle
Definition: AssociativeIterator.h:50
ESDcsInfoTask::prefixME_
std::string prefixME_
Definition: ESDcsInfoTask.h:41
ESDcsInfoTask::ievt_
int ievt_
Definition: ESDcsInfoTask.h:50
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:354
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
ESDcsInfoTask::meESDcsFraction_
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:47
ESDcsInfoTask::dcsStatustoken_
edm::EDGetTokenT< DcsStatusCollection > dcsStatustoken_
Definition: ESDcsInfoTask.h:45
edm::Service
Definition: Service.h:30
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
ESDcsInfoTask::mergeRuns_
bool mergeRuns_
Definition: ESDcsInfoTask.h:43
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DcsStatus::ESm
Definition: DcsStatus.h:58
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
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
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
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37