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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
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)
 
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
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 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::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

Definition at line 14 of file ESDcsInfoTask.h.

Definition at line 13 of file ESDcsInfoTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 19 of file ESDcsInfoTask.cc.

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

19  {
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 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:47
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
edm::EDGetTokenT< DcsStatusCollection > dcsStatustoken_
Definition: ESDcsInfoTask.h:45
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:39
std::string prefixME_
Definition: ESDcsInfoTask.h:41
ESDcsInfoTask::~ESDcsInfoTask ( )
override

Destructor.

Definition at line 32 of file ESDcsInfoTask.cc.

32 {}

Member Function Documentation

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

Analyze.

Definition at line 68 of file ESDcsInfoTask.cc.

References DEFINE_FWK_MODULE, DcsStatus::ESm, DcsStatus::ESp, dqmMemoryStats::float, edm::Event::getByToken(), and edm::HandleBase::isValid().

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 }
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:47
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
void Fill(long long x)
edm::EDGetTokenT< DcsStatusCollection > dcsStatustoken_
Definition: ESDcsInfoTask.h:45
bool isValid() const
Definition: HandleBase.h:70
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void ESDcsInfoTask::beginJob ( void  )
overrideprotectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 34 of file ESDcsInfoTask.cc.

References timingPdfMaker::histo.

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");
45  meESDcsActiveMap_ = dqmStore_->book1D(histo, histo, 2, 0., 2.);
46  meESDcsActiveMap_->setAxisTitle("(ES+/ES-)", 1);
47  }
48 }
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:47
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
void Fill(long long x)
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:39
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:639
std::string prefixME_
Definition: ESDcsInfoTask.h:41
MonitorElement * bookFloat(char_string const &name)
Book float.
Definition: DQMStore.cc:1087
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
Definition: DQMStore.cc:1121
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void ESDcsInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
overrideprotected

BeginLuminosityBlock.

Definition at line 52 of file ESDcsInfoTask.cc.

References mps_fire::i, and reset().

52  {
53  this->reset();
54 
55  for (int i = 0; i < 2; i++) {
56  meESDcsActiveMap_->setBinContent(i + 1, -1.0);
57  }
58 }
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void reset(void)
Reset.
void ESDcsInfoTask::endJob ( void  )
overrideprotectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 50 of file ESDcsInfoTask.cc.

50 {}
void ESDcsInfoTask::reset ( void  )
protected

Reset.

Definition at line 60 of file ESDcsInfoTask.cc.

60  {
61  if (meESDcsFraction_)
63 
66 }
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:47
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
virtual void Reset()
reset ME (ie. contents, errors, etc)

Member Data Documentation

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

Definition at line 45 of file ESDcsInfoTask.h.

DQMStore* ESDcsInfoTask::dqmStore_
private

Definition at line 39 of file ESDcsInfoTask.h.

int ESDcsInfoTask::ievt_
private

Definition at line 50 of file ESDcsInfoTask.h.

MonitorElement* ESDcsInfoTask::meESDcsActiveMap_
private

Definition at line 48 of file ESDcsInfoTask.h.

MonitorElement* ESDcsInfoTask::meESDcsFraction_
private

Definition at line 47 of file ESDcsInfoTask.h.

bool ESDcsInfoTask::mergeRuns_
private

Definition at line 43 of file ESDcsInfoTask.h.

std::string ESDcsInfoTask::prefixME_
private

Definition at line 41 of file ESDcsInfoTask.h.